diff options
author | Ben Murdoch <benm@google.com> | 2010-06-15 19:36:43 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-06-16 14:52:28 +0100 |
commit | 545e470e52f0ac6a3a072bf559c796b42c6066b6 (patch) | |
tree | c0c14763654d84d37577dde512c3d3b4699a9e86 /WebCore/inspector/front-end/Settings.js | |
parent | 719298a66237d38ea5c05f1547123ad8aacbc237 (diff) | |
download | external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.zip external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.gz external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.bz2 |
Merge webkit.org at r61121: Initial merge by git.
Change-Id: Icd6db395c62285be384d137164d95d7466c98760
Diffstat (limited to 'WebCore/inspector/front-end/Settings.js')
-rw-r--r-- | WebCore/inspector/front-end/Settings.js | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js index b9b5f75..c7fc5a9 100644 --- a/WebCore/inspector/front-end/Settings.js +++ b/WebCore/inspector/front-end/Settings.js @@ -30,6 +30,7 @@ var Preferences = { + canEditScriptSource: false, maxInlineTextChildLength: 80, minConsoleHeight: 75, minSidebarWidth: 100, @@ -44,16 +45,39 @@ var Preferences = { auditsPanelEnabled: true } -WebInspector.populateFrontendSettings = function(settingsString) +WebInspector.populateApplicationSettings = function(settingsString) { - WebInspector.settings._load(settingsString); + WebInspector.applicationSettings._load(settingsString); + WebInspector.applicationSettings._installSetting("eventListenersFilter", "event-listeners-filter", "all"); + WebInspector.applicationSettings._installSetting("colorFormat", "color-format", "hex"); + WebInspector.applicationSettings._installSetting("resourcesLargeRows", "resources-large-rows", true); + WebInspector.applicationSettings._installSetting("watchExpressions", "watch-expressions", []); + WebInspector.applicationSettings._installSetting("lastViewedScriptFile", "last-viewed-script-file"); + WebInspector.applicationSettings._installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false); + WebInspector.applicationSettings._installSetting("showUserAgentStyles", "show-user-agent-styles", true); + WebInspector.applicationSettings._installSetting("resourceViewTab", "resource-view-tab", "content"); + WebInspector.applicationSettings._installSetting("consoleHistory", "console-history", []); + WebInspector.applicationSettings.dispatchEventToListeners("loaded"); } -WebInspector.Settings = function() +WebInspector.populateSessionSettings = function(settingsString) { + WebInspector.sessionSettings._load(settingsString); + WebInspector.sessionSettings.dispatchEventToListeners("loaded"); +} + +WebInspector.Settings = function(sessionScope) +{ + this._sessionScope = sessionScope; } WebInspector.Settings.prototype = { + reset: function() + { + this._store = {}; + this.dispatchEventToListeners("loaded"); + }, + _load: function(settingsString) { try { @@ -62,17 +86,6 @@ WebInspector.Settings.prototype = { // May fail; this._store = {}; } - - this._installSetting("eventListenersFilter", "event-listeners-filter", "all"); - this._installSetting("colorFormat", "color-format", "hex"); - this._installSetting("resourcesLargeRows", "resources-large-rows", true); - this._installSetting("watchExpressions", "watch-expressions", []); - this._installSetting("lastViewedScriptFile", "last-viewed-script-file"); - this._installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false); - this._installSetting("showUserAgentStyles", "show-user-agent-styles", true); - this._installSetting("resourceViewTab", "resource-view-tab", "content"); - this._installSetting("consoleHistory", "console-history", []); - this.dispatchEventToListeners("loaded"); }, _installSetting: function(name, propertyName, defaultValue) @@ -93,7 +106,11 @@ WebInspector.Settings.prototype = { { this._store[propertyName] = newValue; try { - InspectorBackend.saveFrontendSettings(JSON.stringify(this._store)); + var store = JSON.stringify(this._store); + if (this._sessionScope) + InspectorBackend.saveSessionSettings(store); + else + InspectorBackend.saveApplicationSettings(store); } catch (e) { // May fail; } |