Changeset 100277 in webkit


Ignore:
Timestamp:
Nov 15, 2011 6:52:25 AM (12 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: move generic code from DevTools.js into the WebCore.
https://bugs.webkit.org/show_bug.cgi?id=72377

re-landing r100269.

Reviewed by Yury Semikhatsky.

Source/WebCore:

  • English.lproj/localizedStrings.js:
  • inspector/front-end/InspectorFrontendHostStub.js:

(.WebInspector.InspectorFrontendHostStub.prototype.inspectedURLChanged):

  • inspector/front-end/ProfilesPanel.js:
  • inspector/front-end/Resource.js:
  • inspector/front-end/Settings.js:
  • inspector/front-end/UIUtils.js:

(WebInspector.setToolbarColors):
(WebInspector.resetToolbarColors):

  • inspector/front-end/inspector.js:

Source/WebKit/chromium:

  • src/js/DevTools.js:

(WebInspector.setInspectedTabId):

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r100274 r100277  
     12011-11-15  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: move generic code from DevTools.js into the WebCore.
     4        https://bugs.webkit.org/show_bug.cgi?id=72377
     5
     6        re-landing r100269.
     7
     8        Reviewed by Yury Semikhatsky.
     9
     10        * English.lproj/localizedStrings.js:
     11        * inspector/front-end/InspectorFrontendHostStub.js:
     12        (.WebInspector.InspectorFrontendHostStub.prototype.inspectedURLChanged):
     13        * inspector/front-end/ProfilesPanel.js:
     14        * inspector/front-end/Resource.js:
     15        * inspector/front-end/Settings.js:
     16        * inspector/front-end/UIUtils.js:
     17        (WebInspector.setToolbarColors):
     18        (WebInspector.resetToolbarColors):
     19        * inspector/front-end/inspector.js:
     20
    1212011-11-15  Sheriff Bot  <webkit.review.bot@gmail.com>
    222
  • trunk/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js

    r100274 r100277  
    111111    inspectedURLChanged: function(url)
    112112    {
     113        document.title = WebInspector.UIString(Preferences.applicationTitle, url);
    113114    },
    114115
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r100274 r100277  
    120120    this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
    121121    this.enableToggleButton.addEventListener("click", this._toggleProfiling.bind(this), false);
     122    if (Preferences.profilerAlwaysEnabled)
     123        this.enableToggleButton.element.addStyleClass("hidden");
    122124
    123125    this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear all profiles."), "clear-status-bar-item");
  • trunk/Source/WebCore/inspector/front-end/Resource.js

    r100274 r100277  
    4545    "image/svg+xml":               {2: true},
    4646    "image/vnd.microsoft.icon":    {2: true},
     47    "image/webp":                  {2: true},
    4748    "image/x-icon":                {2: true},
    4849    "image/x-xbitmap":             {2: true},
  • trunk/Source/WebCore/inspector/front-end/Settings.js

    r100274 r100277  
    5959    haveExtensions: false,
    6060    sharedWorkersDebugNote: undefined,
    61     localizeUI: true
     61    localizeUI: true,
     62    applicationTitle: "Web Inspector - %s"
    6263}
    6364
  • trunk/Source/WebCore/inspector/front-end/UIUtils.js

    r100274 r100277  
    596596}
    597597
     598WebInspector.setToolbarColors = function(backgroundColor, color)
     599{
     600    if (!WebInspector._themeStyleElement) {
     601        WebInspector._themeStyleElement = document.createElement("style");
     602        document.head.appendChild(WebInspector._themeStyleElement);
     603    }
     604    WebInspector._themeStyleElement.textContent =
     605        "#toolbar {\
     606             background-image: none !important;\
     607             background-color: " + backgroundColor + " !important;\
     608         }\
     609         \
     610         .toolbar-label {\
     611             color: " + color + " !important;\
     612             text-shadow: none;\
     613         }";
     614}
     615
     616WebInspector.resetToolbarColors = function()
     617{
     618    if (WebInspector._themeStyleElement)
     619        WebInspector._themeStyleElement.textContent = "";
     620
     621}
     622
    598623;(function() {
    599624
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r100274 r100277  
    320320        document.body.addStyleClass("remote");
    321321
     322    if (WebInspector.queryParamsObject.toolbarColor && WebInspector.queryParamsObject.textColor)
     323        WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbarColor, WebInspector.queryParamsObject.textColor);
     324
    322325    WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen();
    323326    this._registerShortcuts();
  • trunk/Source/WebKit/chromium/ChangeLog

    r100274 r100277  
     12011-11-15  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: move generic code from DevTools.js into the WebCore.
     4        https://bugs.webkit.org/show_bug.cgi?id=72377
     5
     6        re-landing r100269.
     7
     8        Reviewed by Yury Semikhatsky.
     9
     10        * src/js/DevTools.js:
     11        (WebInspector.setInspectedTabId):
     12
    1132011-11-15  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/WebKit/chromium/src/js/DevTools.js

    r100274 r100277  
    3030
    3131/**
    32  * FIXME: change field naming style to use trailing underscore.
    33  * @fileoverview Tools is a main class that wires all components of the
    34  * DevTools frontend together. It is also responsible for overriding existing
    35  * WebInspector functionality while it is getting upstreamed into WebCore.
     32 * DevTools.js is responsible for configuring Web Inspector for the Chromium
     33 * port as well as additional features specific to the Chromium port.
    3634 */
    3735
    38 var context = {};  // Used by WebCore's inspector routines.
    39 
    40 (function () {
     36{(function () {
    4137    Preferences.ignoreWhitespace = false;
    4238    Preferences.samplingCPUProfiler = true;
     
    6056    Preferences.sharedWorkersDebugNote = "Shared workers can be inspected in the Task Manager";
    6157    Preferences.localizeUI = false;
    62 })();
    63 
    64 // Recognize WebP as a valid image mime type.
    65 WebInspector.MIMETypes["image/webp"] = {2: true};
    66 
    67 var devtools = devtools || {};
    68 
    69 devtools.domContentLoaded = function()
    70 {
    71     if (WebInspector.queryParamsObject.toolbarColor && WebInspector.queryParamsObject.textColor)
    72         WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbarColor, WebInspector.queryParamsObject.textColor);
    73 }
    74 document.addEventListener("DOMContentLoaded", devtools.domContentLoaded, false);
    75 
    76 
    77 // FIXME: This needs to be upstreamed.
    78 (function InterceptProfilesPanelEvents()
    79 {
    80     var oldShow = WebInspector.ProfilesPanel.prototype.show;
    81     WebInspector.ProfilesPanel.prototype.show = function()
    82     {
    83         this.enableToggleButton.visible = false;
    84         oldShow.call(this);
    85         // Show is called on every show event of a panel, so
    86         // we only need to intercept it once.
    87         WebInspector.ProfilesPanel.prototype.show = oldShow;
    88     };
    89 })();
    90 
    91 
    92 /*
    93  * @override
    94  * TODO(mnaganov): Restore l10n when it will be agreed that it is needed.
    95  */
    96 WebInspector.UIString = function(string)
    97 {
    98     return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));
    99 };
    100 
     58    Preferences.applicationTitle = "Developer Tools - %s";
     59})();}
    10160
    10261/** Pending WebKit upstream by apavlov). Fixes iframe vs drag problem. */
     
    13897})();
    13998
    140 
    141 /////////////////////////////
    142 // Chromium theme support. //
    143 /////////////////////////////
    144 
    145 WebInspector.setToolbarColors = function(backgroundColor, color)
    146 {
    147     if (!WebInspector._themeStyleElement) {
    148         WebInspector._themeStyleElement = document.createElement("style");
    149         document.head.appendChild(WebInspector._themeStyleElement);
    150     }
    151     WebInspector._themeStyleElement.textContent =
    152         "#toolbar {\
    153              background-image: none !important;\
    154              background-color: " + backgroundColor + " !important;\
    155          }\
    156          \
    157          .toolbar-label {\
    158              color: " + color + " !important;\
    159              text-shadow: none;\
    160          }";
    161 }
    162 
    163 WebInspector.resetToolbarColors = function()
    164 {
    165     if (WebInspector._themeStyleElement)
    166         WebInspector._themeStyleElement.textContent = "";
    167 
    168 }
    169 
    170 ////////////////////////////////////////////////////////
    171 // Platform-specific WebInspector extensions support. //
    172 ////////////////////////////////////////////////////////
    173 
    17499WebInspector.platformExtensionAPI = function(tabId)
    175100{
     
    199124    WebInspector._inspectedTabId = tabId;
    200125}
    201 
    202 if (WebInspector.InspectorFrontendHostStub) {
    203     WebInspector.InspectorFrontendHostStub.prototype.inspectedURLChanged = function(url)
    204     {
    205         document.title = "Developer Tools - " + url;
    206     }
    207 }
Note: See TracChangeset for help on using the changeset viewer.