Chromium Code Reviews| 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 |
| +} |