Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1542)

Unified Diff: Source/devtools/front_end/SourcesPanel.js

Issue 213423010: DevTools: Migrate General tab settings to extensions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/SourcesPanel.js
diff --git a/Source/devtools/front_end/SourcesPanel.js b/Source/devtools/front_end/SourcesPanel.js
index a10ebfd7e3a2a441a91c7de5d4551afdc78a209c..b9193c1fc75d1c7ad224fdc98aa234d4a122f63d 100644
--- a/Source/devtools/front_end/SourcesPanel.js
+++ b/Source/devtools/front_end/SourcesPanel.js
@@ -1238,3 +1238,92 @@ WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate.prototype = {
return true;
}
}
+
+/**
+ * @constructor
+ * @extends {WebInspector.InputUISettingDelegate}
+ */
+WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate = function()
+{
+ WebInspector.InputUISettingDelegate.call(this);
+}
+
+WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate.prototype = {
+ settingChanged: function()
+ {
+ WebInspector.debuggerModel.applySkipStackFrameSettings();
pfeldman 2014/03/27 15:27:14 The only thing Setting-based setting should do is
apavlov 2014/03/28 10:21:23 Done.
+ },
+
+ /**
+ * @override
+ * @param {string} value
+ * @return {?string}
+ */
+ validateInput: function(value)
+ {
+ return WebInspector.SettingsUI.regexValidator(value);
+ },
+
+ __proto__: WebInspector.InputUISettingDelegate.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.UISettingDelegate}
+ * @implements {WebInspector.ConfigurableUISettingDelegate}
+ */
+WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate = function()
+{
+ WebInspector.UISettingDelegate.call(this);
+}
+
+WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate.prototype = {
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ settingChanged: function(event)
+ {
+ PageAgent.setScriptExecutionDisabled(event.data, this._updateScriptDisabledCheckbox.bind(this));
+ },
+
+ /**
+ * @override
+ * @param {!Element} settingElement
+ * @param {!Element} containerElement
+ */
+ configure: function(settingElement, containerElement)
+ {
+ this._disableJSCheckbox = settingElement.getElementsByTagName("input")[0];
+ var disableJSInfoParent = this._disableJSCheckbox.parentElement.createChild("span", "monospace");
+ this._disableJSInfo = disableJSInfoParent.createChild("span", "object-info-state-note hidden");
+ this._disableJSInfo.title = WebInspector.UIString("JavaScript is blocked on the inspected page (may be disabled in browser settings).");
+
+ WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._updateScriptDisabledCheckbox, this);
+ this._updateScriptDisabledCheckbox();
+ },
+
+ _updateScriptDisabledCheckbox: function()
+ {
+ PageAgent.getScriptExecutionStatus(executionStatusCallback.bind(this));
+
+ /**
+ * @param {?Protocol.Error} error
+ * @param {string} status
+ * @this {WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate}
+ */
+ function executionStatusCallback(error, status)
+ {
+ if (error || !status)
+ return;
+
+ var forbidden = (status === "forbidden");
+ var disabled = forbidden || (status === "disabled");
+
+ this._disableJSInfo.classList.toggle("hidden", !forbidden);
+ this._disableJSCheckbox.checked = disabled;
+ this._disableJSCheckbox.disabled = forbidden;
+ }
+ },
+
+ __proto__: WebInspector.UISettingDelegate.prototype
+}

Powered by Google App Engine
This is Rietveld 408576698