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

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: Comments addressed 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
« no previous file with comments | « Source/devtools/front_end/SettingsUI.js ('k') | Source/devtools/front_end/helpScreen.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/SourcesPanel.js
diff --git a/Source/devtools/front_end/SourcesPanel.js b/Source/devtools/front_end/SourcesPanel.js
index e2299c0b041eba6da32aac58e7cb5ef19ba0c79f..4982e3026e47be6137cea158650f7cf3ad196c46 100644
--- a/Source/devtools/front_end/SourcesPanel.js
+++ b/Source/devtools/front_end/SourcesPanel.js
@@ -1239,3 +1239,87 @@ WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate.prototype = {
return true;
}
}
+
+/**
+ * @constructor
+ * @extends {WebInspector.UISettingDelegate}
+ */
+WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate = function()
+{
+ WebInspector.UISettingDelegate.call(this);
+}
+
+WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate.prototype = {
+ /**
+ * @override
+ * @return {!Element}
+ */
+ settingElement: function()
+ {
+ return WebInspector.SettingsUI.createSettingInputField(WebInspector.UIString("Pattern"), WebInspector.settings.skipStackFramesPattern, false, 1000, "100px", WebInspector.SettingsUI.regexValidator);
+ },
+
+ __proto__: WebInspector.UISettingDelegate.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.UISettingDelegate}
+ */
+WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate = function()
+{
+ WebInspector.UISettingDelegate.call(this);
+}
+
+WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate.prototype = {
+ /**
+ * @override
+ * @return {!Element}
+ */
+ settingElement: function()
+ {
+ var disableJSElement = WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Disable JavaScript"), WebInspector.settings.javaScriptDisabled);
+ this._disableJSCheckbox = disableJSElement.getElementsByTagName("input")[0];
+ WebInspector.settings.javaScriptDisabled.addChangeListener(this._settingChanged, this);
+ 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();
+ return disableJSElement;
+ },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _settingChanged: function(event)
+ {
+ PageAgent.setScriptExecutionDisabled(event.data, this._updateScriptDisabledCheckbox.bind(this));
+ },
+
+ _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
+}
« no previous file with comments | « Source/devtools/front_end/SettingsUI.js ('k') | Source/devtools/front_end/helpScreen.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698