| Index: Source/devtools/front_end/SourcesPanel.js
|
| diff --git a/Source/devtools/front_end/SourcesPanel.js b/Source/devtools/front_end/SourcesPanel.js
|
| index e617973d7bc8b7143647d1f6f423ba6e747f9ccc..e70cee92e2bd3022a9876771fa1270e9f708fd58 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
|
| + * @param {!WebInspector.Event} event
|
| + */
|
| + settingChanged: function(event)
|
| + {
|
| + PageAgent.setScriptExecutionDisabled(event.data, this._updateScriptDisabledCheckbox.bind(this));
|
| + },
|
| +
|
| + /**
|
| + * @override
|
| + * @return {!Element}
|
| + */
|
| + settingElement: function()
|
| + {
|
| + var disableJSElement = WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Disable JavaScript"), WebInspector.settings.javaScriptDisabled);
|
| + this._disableJSCheckbox = disableJSElement.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();
|
| + return disableJSElement;
|
| + },
|
| +
|
| + _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
|
| +}
|
|
|