Title: [101381] trunk
Revision
101381
Author
pfeld...@chromium.org
Date
2011-11-29 08:01:30 -0800 (Tue, 29 Nov 2011)

Log Message

Web Inspector: split Preferences into Preferences and Capabilities.
https://bugs.webkit.org/show_bug.cgi?id=73321

Source/WebCore:

Part of the Preferences defined in Settings.js are in fact backend capabilities.
Split them into two separate objects for further capabilities refactoring.

Reviewed by Yury Semikhatsky.

* inspector/front-end/DebuggerModel.js:
* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel):
(WebInspector.ElementsPanel.prototype.wasShown):
(WebInspector.ElementsPanel.prototype._populateContextMenu):
* inspector/front-end/NetworkItemView.js:
(WebInspector.NetworkItemView):
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView.prototype._createTable):
(WebInspector.NetworkLogView.prototype.switchToDetailedView):
(WebInspector.NetworkLogView.prototype.switchToBriefView):
(WebInspector.NetworkLogView.prototype._contextMenu):
(WebInspector.NetworkDataGridNode.prototype.createCells):
(WebInspector.NetworkDataGridNode.prototype.refreshResource):
* inspector/front-end/ProfileDataGridTree.js:
(WebInspector.ProfileDataGridNode.prototype.get data.formatMilliseconds):
* inspector/front-end/ProfileView.js:
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._enableDetailedHeapProfiles):
* inspector/front-end/Resource.js:
(WebInspector.Resource.prototype.populateImageSource):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype.wasShown):
(WebInspector.ScriptsPanel.prototype._clearInterface):
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.SettingsScreen):
* inspector/front-end/StylesSidebarPane.js:
* inspector/front-end/inspector.js:

Source/WebKit/chromium:

Reviewed by Yury Semikhatsky.

* src/js/DevTools.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/inspector/profiler/detailed-heapshots-test.js (101380 => 101381)


--- trunk/LayoutTests/inspector/profiler/detailed-heapshots-test.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/LayoutTests/inspector/profiler/detailed-heapshots-test.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -13,7 +13,7 @@
         InspectorTest._panelReset = InspectorTest.override(WebInspector.panels.profiles, "_reset", function(){}, true);
         InspectorTest.addSniffer(WebInspector.DetailedHeapshotView.prototype, "_updatePercentButton", InspectorTest._snapshotViewShown, true);
 
-        if (Preferences.detailedHeapProfiles)
+        if (Capabilities.detailedHeapProfiles)
             detailedHeapProfilesEnabled();
         else {
             InspectorTest.addSniffer(WebInspector.panels.profiles, "_populateProfiles", detailedHeapProfilesEnabled);
@@ -62,7 +62,7 @@
 
 InspectorTest.runDetailedHeapshotTestSuite = function(testSuite)
 {
-    if (!Preferences.heapProfilerPresent) {
+    if (!Capabilities.heapProfilerPresent) {
         InspectorTest.addResult("Heap profiler is disabled");
         InspectorTest.completeTest();
         return;

Modified: trunk/Source/WebCore/ChangeLog (101380 => 101381)


--- trunk/Source/WebCore/ChangeLog	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/ChangeLog	2011-11-29 16:01:30 UTC (rev 101381)
@@ -1,3 +1,43 @@
+2011-11-29  Pavel Feldman  <pfeld...@google.com>
+
+        Web Inspector: split Preferences into Preferences and Capabilities.
+        https://bugs.webkit.org/show_bug.cgi?id=73321
+
+        Part of the Preferences defined in Settings.js are in fact backend capabilities.
+        Split them into two separate objects for further capabilities refactoring.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/DebuggerModel.js:
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel):
+        (WebInspector.ElementsPanel.prototype.wasShown):
+        (WebInspector.ElementsPanel.prototype._populateContextMenu):
+        * inspector/front-end/NetworkItemView.js:
+        (WebInspector.NetworkItemView):
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkLogView.prototype._createTable):
+        (WebInspector.NetworkLogView.prototype.switchToDetailedView):
+        (WebInspector.NetworkLogView.prototype.switchToBriefView):
+        (WebInspector.NetworkLogView.prototype._contextMenu):
+        (WebInspector.NetworkDataGridNode.prototype.createCells):
+        (WebInspector.NetworkDataGridNode.prototype.refreshResource):
+        * inspector/front-end/ProfileDataGridTree.js:
+        (WebInspector.ProfileDataGridNode.prototype.get data.formatMilliseconds):
+        * inspector/front-end/ProfileView.js:
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype._enableDetailedHeapProfiles):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype.populateImageSource):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.wasShown):
+        (WebInspector.ScriptsPanel.prototype._clearInterface):
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/SettingsScreen.js:
+        (WebInspector.SettingsScreen):
+        * inspector/front-end/StylesSidebarPane.js:
+        * inspector/front-end/inspector.js:
+
 2011-11-29  Simon Hausmann  <simon.hausm...@nokia.com>
 
         [Qt] Make WebCore compile with Qt 5 and V8

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerModel.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/DebuggerModel.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerModel.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -89,7 +89,7 @@
     {
         /**
          * @param {Protocol.Error} error
-         * @param {Array.<string>} capabilities
+         * @param {Array.<MetaAgent.DomainCapabilities>} capabilities
          */
         function callback(error, capabilities)
         {

Modified: trunk/Source/WebCore/inspector/front-end/ElementsPanel.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/ElementsPanel.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -70,7 +70,7 @@
     this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle);
     this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane();
     this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();
-    if (Preferences.nativeInstrumentationEnabled)
+    if (Capabilities.nativeInstrumentationEnabled)
         this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane;
     this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane();
 
@@ -137,7 +137,7 @@
         if (!this.treeOutline.rootDOMNode)
             WebInspector.domAgent.requestDocument();
 
-        if (Preferences.nativeInstrumentationEnabled)
+        if (Capabilities.nativeInstrumentationEnabled)
             this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.eventListeners.element);
     },
 
@@ -201,7 +201,7 @@
             return;
         }
 
-        if (Preferences.nativeInstrumentationEnabled)
+        if (Capabilities.nativeInstrumentationEnabled)
             this.sidebarPanes.domBreakpoints.restoreBreakpoints();
 
         /**
@@ -319,7 +319,7 @@
 
     _populateContextMenu: function(contextMenu, node)
     {
-        if (Preferences.nativeInstrumentationEnabled) {
+        if (Capabilities.nativeInstrumentationEnabled) {
             // Add debbuging-related actions
             contextMenu.appendSeparator();
             var pane = this.sidebarPanes.domBreakpoints;

Modified: trunk/Source/WebCore/inspector/front-end/NetworkItemView.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/NetworkItemView.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/NetworkItemView.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -47,12 +47,12 @@
     this.appendTab("preview", WebInspector.UIString("Preview"), previewView);
     this.appendTab("response", WebInspector.UIString("Response"), responseView);
 
-    if (Preferences.showCookiesTab) {
+    if (Capabilities.showCookiesTab) {
         this._cookiesView = new WebInspector.ResourceCookiesView(resource);
         this.appendTab("cookies", WebInspector.UIString("Cookies"), this._cookiesView);
     }
 
-    if (Preferences.showTimingTab) {
+    if (Capabilities.showTimingTab) {
         var timingView = new WebInspector.ResourceTimingView(resource);
         this.appendTab("timing", WebInspector.UIString("Timing"), timingView);
     }

Modified: trunk/Source/WebCore/inspector/front-end/NetworkPanel.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -139,7 +139,7 @@
     _createTable: function()
     {
         var columns;
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             columns = {name: {}, method: {}, status: {}, type: {}, initiator: {}, size: {}, time: {}, timeline: {}};
         else
             columns = {name: {}, method: {}, status: {}, type: {}, size: {}, time: {}, timeline: {}};
@@ -160,7 +160,7 @@
         columns.type.sortable = true;
         columns.type.width = "6%";
 
-        if (Preferences.showNetworkPanelInitiatorColumn) {
+        if (Capabilities.nativeInstrumentationEnabled) {
             columns.initiator.title = WebInspector.UIString("Initiator");
             columns.initiator.sortable = true;
             columns.initiator.width = "10%";
@@ -178,7 +178,7 @@
 
         columns.timeline.title = "";
         columns.timeline.sortable = false;
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             columns.timeline.width = "40%";
         else
             columns.timeline.width = "50%";
@@ -831,7 +831,7 @@
         this._dataGrid.showColumn("method");
         this._dataGrid.showColumn("status");
         this._dataGrid.showColumn("type");
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             this._dataGrid.showColumn("initiator");
         this._dataGrid.showColumn("size");
         this._dataGrid.showColumn("time");
@@ -842,11 +842,11 @@
         widths.method = 6;
         widths.status = 6;
         widths.type = 6;
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             widths.initiator = 10;
         widths.size = 6;
         widths.time = 6;
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             widths.timeline = 40;
         else
             widths.timeline = 50;
@@ -862,7 +862,7 @@
         this._dataGrid.hideColumn("method");
         this._dataGrid.hideColumn("status");
         this._dataGrid.hideColumn("type");
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             this._dataGrid.hideColumn("initiator");
         this._dataGrid.hideColumn("size");
         this._dataGrid.hideColumn("time");
@@ -940,7 +940,7 @@
             contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save all as HAR" : "Save All as HAR"), this._exportAll.bind(this));
         }
 
-        if (Preferences.canClearCacheAndCookies) {
+        if (Capabilities.canClearCacheAndCookies) {
             contextMenu.appendSeparator();
             contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Clear browser cache" : "Clear Browser Cache"), this._clearBrowserCache.bind(this));
             contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Clear browser cookies" : "Clear Browser Cookies"), this._clearBrowserCookies.bind(this));
@@ -1686,7 +1686,7 @@
         this._methodCell = this._createDivInTD("method");
         this._statusCell = this._createDivInTD("status");
         this._typeCell = this._createDivInTD("type");
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             this._initiatorCell = this._createDivInTD("initiator");
         this._sizeCell = this._createDivInTD("size");
         this._timeCell = this._createDivInTD("time");
@@ -1780,7 +1780,7 @@
 
         this._refreshStatusCell();
         this._refreshTypeCell();
-        if (Preferences.showNetworkPanelInitiatorColumn)
+        if (Capabilities.nativeInstrumentationEnabled)
             this._refreshInitiatorCell();
         this._refreshSizeCell();
         this._refreshTimeCell();

Modified: trunk/Source/WebCore/inspector/front-end/ProfileDataGridTree.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/ProfileDataGridTree.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/ProfileDataGridTree.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -50,7 +50,7 @@
     {
         function formatMilliseconds(time)
         {
-            return Number.secondsToString(time / 1000, !Preferences.samplingCPUProfiler);
+            return Number.secondsToString(time / 1000, !Capabilities.samplingCPUProfiler);
         }
 
         var data = ""

Modified: trunk/Source/WebCore/inspector/front-end/ProfileView.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/ProfileView.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/ProfileView.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -42,7 +42,7 @@
                     "calls": { title: WebInspector.UIString("Calls"), width: "54px", sortable: true },
                     "function": { title: WebInspector.UIString("Function"), disclosure: true, sortable: true } };
 
-    if (Preferences.samplingCPUProfiler) {
+    if (Capabilities.samplingCPUProfiler) {
         delete columns.average;
         delete columns.calls;
     }

Modified: trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -119,7 +119,7 @@
 
     this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
     this.enableToggleButton.addEventListener("click", this._toggleProfiling.bind(this), false);
-    if (Preferences.profilerAlwaysEnabled)
+    if (Capabilities.profilerAlwaysEnabled)
         this.enableToggleButton.element.addStyleClass("hidden");
 
     this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear all profiles."), "clear-status-bar-item");
@@ -131,16 +131,16 @@
     this.welcomeView = new WebInspector.WelcomeView("profiles", WebInspector.UIString("Welcome to the Profiles panel"));
 
     this._profiles = [];
-    this._profilerEnabled = Preferences.profilerAlwaysEnabled;
+    this._profilerEnabled = Capabilities.profilerAlwaysEnabled;
     this._reset();
 
     this._registerProfileType(new WebInspector.CPUProfileType());
-    if (Preferences.heapProfilerPresent)
+    if (Capabilities.heapProfilerPresent)
         this._registerProfileType(new WebInspector.DetailedHeapshotProfileType());
 
     InspectorBackend.registerProfilerDispatcher(new WebInspector.ProfilerDispatcher(this));
 
-    if (Preferences.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled.get())
+    if (Capabilities.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled.get())
         ProfilerAgent.enable();
     else {
         function onProfilerEnebled(error, value) {
@@ -889,7 +889,7 @@
         var profileType = new WebInspector.DetailedHeapshotProfileType();
         profileType.treeElement = oldProfileType.treeElement;
         this._profileTypesByIdMap[profileType.id] = profileType;
-        Preferences.detailedHeapProfiles = true;
+        Capabilities.detailedHeapProfiles = true;
         this.detach();
         this.show();
     }

Modified: trunk/Source/WebCore/inspector/front-end/Resource.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/Resource.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/Resource.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -891,10 +891,7 @@
             image.src = ""
         }
 
-        if (Preferences.useDataURLForResourceImageIcons)
-            this.requestContent(onResourceContent.bind(this));
-        else
-            image.src = ""
+        this.requestContent(onResourceContent.bind(this));
     },
 
     isHttpFamily: function()

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -68,13 +68,13 @@
     this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(this._presentationModel);
     this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();
     this.sidebarPanes.jsBreakpoints = new WebInspector._javascript_BreakpointsSidebarPane(this._presentationModel, this._showSourceLine.bind(this));
-    if (Preferences.nativeInstrumentationEnabled) {
+    if (Capabilities.nativeInstrumentationEnabled) {
         this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane;
         this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane();
         this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane();
     }
 
-    if (Preferences.canInspectWorkers && !WebInspector.WorkerManager.isWorkerFrontend()) {
+    if (Capabilities.canInspectWorkers && !WebInspector.WorkerManager.isWorkerFrontend()) {
         WorkerAgent.setWorkerInspectionEnabled(true);
         this.sidebarPanes.workerList = new WebInspector.WorkerListSidebarPane(WebInspector.workerManager);
     } else
@@ -103,7 +103,7 @@
 
     this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
     this.enableToggleButton.addEventListener("click", this.toggleDebugging, this);
-    if (Preferences.debuggerAlwaysEnabled)
+    if (Capabilities.debuggerAlwaysEnabled)
         this.enableToggleButton.element.addStyleClass("hidden");
 
     this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
@@ -116,7 +116,7 @@
     this._scriptViewStatusBarItemsContainer = document.createElement("div");
     this._scriptViewStatusBarItemsContainer.style.display = "inline-block";
 
-    this._debuggerEnabled = Preferences.debuggerAlwaysEnabled;
+    this._debuggerEnabled = Capabilities.debuggerAlwaysEnabled;
 
     this._reset(false);
 
@@ -137,7 +137,7 @@
     this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.ExecutionLineChanged, this._executionLineChanged, this);
     this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.DebuggerReset, this._reset.bind(this, false));
     
-    var enableDebugger = Preferences.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled.get();
+    var enableDebugger = Capabilities.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled.get();
     if (enableDebugger)
         WebInspector.debuggerModel.enableDebugger();
 
@@ -177,7 +177,7 @@
     wasShown: function()
     {
         WebInspector.Panel.prototype.wasShown.call(this);
-        if (Preferences.nativeInstrumentationEnabled)
+        if (Capabilities.nativeInstrumentationEnabled)
             this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.xhrBreakpoints.element);
         this.sidebarPanes.watchExpressions.show();
     },
@@ -802,7 +802,7 @@
         this.sidebarPanes.callstack.update(null);
         this.sidebarPanes.scopechain.update(null);
         this.sidebarPanes.jsBreakpoints.clearBreakpointHighlight();
-        if (Preferences.nativeInstrumentationEnabled) {
+        if (Capabilities.nativeInstrumentationEnabled) {
             this.sidebarPanes.domBreakpoints.clearBreakpointHighlight();
             this.sidebarPanes.eventListenerBreakpoints.clearBreakpointHighlight();
             this.sidebarPanes.xhrBreakpoints.clearBreakpointHighlight();

Modified: trunk/Source/WebCore/inspector/front-end/Settings.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/Settings.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/Settings.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -37,27 +37,27 @@
     minScriptsSidebarWidth: 200,
     styleRulesExpandedState: {},
     showMissingLocalizedStrings: false,
+    showColorNicknames: true,
+    saveAsAvailable: false,
+    useLowerCaseMenuTitlesOnWindows: false,
+    hasExtensions: false,
+    sharedWorkersDebugNote: undefined,
+    localizeUI: true,
+    applicationTitle: "Web Inspector - %s"
+}
+
+var Capabilities = {
     samplingCPUProfiler: false,
-    showColorNicknames: true,
     debuggerAlwaysEnabled: false,
     profilerAlwaysEnabled: false,
     nativeInstrumentationEnabled: false,
-    useDataURLForResourceImageIcons: true,
     showTimingTab: false,
     showCookiesTab: false,
-    debugMode: false,
     heapProfilerPresent: false,
     detailedHeapProfiles: false,
-    saveAsAvailable: false,
-    useLowerCaseMenuTitlesOnWindows: false,
     canInspectWorkers: false,
     canClearCacheAndCookies: false,
-    canDisableCache: false,
-    showNetworkPanelInitiatorColumn: false,
-    haveExtensions: false,
-    sharedWorkersDebugNote: undefined,
-    localizeUI: true,
-    applicationTitle: "Web Inspector - %s"
+    canDisableCache: false
 }
 
 /**

Modified: trunk/Source/WebCore/inspector/front-end/SettingsScreen.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/SettingsScreen.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/SettingsScreen.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -59,7 +59,7 @@
         ], WebInspector.settings.textEditorIndent));
 
     p = this._appendSection(WebInspector.UIString("Network"), true);
-    if (Preferences.canDisableCache)
+    if (Capabilities.canDisableCache)
         p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Disable cache"), WebInspector.settings.cacheDisabled));
     p.appendChild(this._createUserActionControl());
 
@@ -71,7 +71,7 @@
     p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Log XMLHttpRequests"), WebInspector.settings.monitoringXHREnabled));
     p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Preserve log upon navigation"), WebInspector.settings.preserveConsoleLog));
 
-    if (Preferences.haveExtensions) {
+    if (Preferences.hasExtensions) {
         var handlerSelector = new WebInspector.HandlerSelector(WebInspector.openAnchorLocationRegistry);
         p = this._appendSection(WebInspector.UIString("Extensions"), true);
         p.appendChild(this._createCustomSetting(WebInspector.UIString("Open links in"), handlerSelector.element));

Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -889,8 +889,6 @@
     this._selectorElement = document.createElement("span");
     this._selectorElement.textContent = styleRule.selectorText;
     selectorContainer.appendChild(this._selectorElement);
-    if (Preferences.debugMode)
-        this._selectorElement.addEventListener("click", this._debugShowStyle.bind(this), false);
 
     var openBrace = document.createElement("span");
     openBrace.textContent = " {";
@@ -1135,39 +1133,6 @@
         return item;
     },
 
-    _debugShowStyle: function(event)
-    {
-        var boundHandler;
-        function removeStyleBox(element, event)
-        {
-            if (event.target === element) {
-                event.stopPropagation();
-                return;
-            }
-            document.body.removeChild(element);
-            document.getElementById("main").removeEventListener("mousedown", boundHandler, true);
-        }
-
-        if (!event.shiftKey)
-            return;
-
-        var container = document.createElement("div");
-        var element = document.createElement("span");
-        container.appendChild(element);
-        element.style.background = ""
-        element.style.display = "inline-block";
-        container.style.cssText = "z-index: 2000000; position: absolute; top: 50px; left: 50px; white-space: pre; overflow: auto; background: white; font-family: monospace; font-size: 12px; border: 1px solid black; opacity: 0.85; -webkit-user-select: text; padding: 2px;";
-        container.style.width = (document.body.offsetWidth - 100) + "px";
-        container.style.height = (document.body.offsetHeight - 100) + "px";
-        document.body.appendChild(container);
-        if (this.rule)
-            element.textContent = this.rule.selectorText + " {" + ((this.styleRule.style.cssText !== undefined) ? this.styleRule.style.cssText : "<no cssText>") + "}";
-        else
-            element.textContent = this.styleRule.style.cssText;
-        boundHandler = removeStyleBox.bind(null, container);
-        document.getElementById("main").addEventListener("mousedown", boundHandler, true);
-    },
-
     _handleEmptySpaceDoubleClick: function(event)
     {
         if (event.target.hasStyleClass("header") || this.element.hasStyleClass("read-only") || event.target.enclosingNodeOrSelfWithClass("media")) {

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (101380 => 101381)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -358,7 +358,7 @@
     this.searchController = new WebInspector.SearchController();
     this.advancedSearchController = new WebInspector.AdvancedSearchController();
 
-    if (Preferences.nativeInstrumentationEnabled)
+    if (Capabilities.nativeInstrumentationEnabled)
         this.domBreakpointsSidebarPane = new WebInspector.DOMBreakpointsSidebarPane();
 
     this._createPanels();

Modified: trunk/Source/WebKit/chromium/ChangeLog (101380 => 101381)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-11-29 16:01:30 UTC (rev 101381)
@@ -1,3 +1,12 @@
+2011-11-29  Pavel Feldman  <pfeld...@google.com>
+
+        Web Inspector: split Preferences into Preferences and Capabilities.
+        https://bugs.webkit.org/show_bug.cgi?id=73321
+
+        Reviewed by Yury Semikhatsky.
+
+        * src/js/DevTools.js:
+
 2011-11-29  Jing Zhao  <jingz...@chromium.org>
 
         Assertion fails when opening two popup menus

Modified: trunk/Source/WebKit/chromium/src/js/DevTools.js (101380 => 101381)


--- trunk/Source/WebKit/chromium/src/js/DevTools.js	2011-11-29 15:56:04 UTC (rev 101380)
+++ trunk/Source/WebKit/chromium/src/js/DevTools.js	2011-11-29 16:01:30 UTC (rev 101381)
@@ -35,25 +35,24 @@
 
 {(function () {
     Preferences.ignoreWhitespace = false;
-    Preferences.samplingCPUProfiler = true;
-    Preferences.heapProfilerPresent = true;
-    Preferences.detailedHeapProfiles = true;
-    Preferences.debuggerAlwaysEnabled = true;
-    Preferences.profilerAlwaysEnabled = true;
-    Preferences.nativeInstrumentationEnabled = true;
-    Preferences.fileSystemEnabled = false;
-    Preferences.showTimingTab = true;
-    Preferences.showCookiesTab = true;
     Preferences.saveAsAvailable = true;
     Preferences.useLowerCaseMenuTitlesOnWindows = true;
-    Preferences.canInspectWorkers = true;
-    Preferences.canClearCacheAndCookies = true;
-    Preferences.canDisableCache = true;
-    Preferences.showNetworkPanelInitiatorColumn = true;
-    Preferences.haveExtensions = true;
+    Preferences.hasExtensions = true;
     Preferences.sharedWorkersDebugNote = "Shared workers can be inspected in the Task Manager";
     Preferences.localizeUI = false;
     Preferences.applicationTitle = "Developer Tools - %s";
+
+    Capabilities.samplingCPUProfiler = true;
+    Capabilities.heapProfilerPresent = true;
+    Capabilities.detailedHeapProfiles = true;
+    Capabilities.debuggerAlwaysEnabled = true;
+    Capabilities.profilerAlwaysEnabled = true;
+    Capabilities.nativeInstrumentationEnabled = true;
+    Capabilities.showTimingTab = true;
+    Capabilities.showCookiesTab = true;
+    Capabilities.canInspectWorkers = true;
+    Capabilities.canClearCacheAndCookies = true;
+    Capabilities.canDisableCache = true;
 })();}
 
 /** Pending WebKit upstream by apavlov). Fixes iframe vs drag problem. */
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to