Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1231 WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate.prototype = { | 1231 WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate.prototype = { |
| 1232 /** | 1232 /** |
| 1233 * @return {boolean} | 1233 * @return {boolean} |
| 1234 */ | 1234 */ |
| 1235 handleAction: function() | 1235 handleAction: function() |
| 1236 { | 1236 { |
| 1237 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.sh owPanel("sources")).showGoToSourceDialog(); | 1237 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.sh owPanel("sources")).showGoToSourceDialog(); |
| 1238 return true; | 1238 return true; |
| 1239 } | 1239 } |
| 1240 } | 1240 } |
| 1241 | |
| 1242 /** | |
| 1243 * @constructor | |
| 1244 * @extends {WebInspector.InputUISettingDelegate} | |
| 1245 */ | |
| 1246 WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate = function() | |
| 1247 { | |
| 1248 WebInspector.InputUISettingDelegate.call(this); | |
| 1249 } | |
| 1250 | |
| 1251 WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate.prototype = { | |
| 1252 settingChanged: function() | |
| 1253 { | |
| 1254 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.
| |
| 1255 }, | |
| 1256 | |
| 1257 /** | |
| 1258 * @override | |
| 1259 * @param {string} value | |
| 1260 * @return {?string} | |
| 1261 */ | |
| 1262 validateInput: function(value) | |
| 1263 { | |
| 1264 return WebInspector.SettingsUI.regexValidator(value); | |
| 1265 }, | |
| 1266 | |
| 1267 __proto__: WebInspector.InputUISettingDelegate.prototype | |
| 1268 } | |
| 1269 | |
| 1270 /** | |
| 1271 * @constructor | |
| 1272 * @extends {WebInspector.UISettingDelegate} | |
| 1273 * @implements {WebInspector.ConfigurableUISettingDelegate} | |
| 1274 */ | |
| 1275 WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate = function() | |
| 1276 { | |
| 1277 WebInspector.UISettingDelegate.call(this); | |
| 1278 } | |
| 1279 | |
| 1280 WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate.prototype = { | |
| 1281 /** | |
| 1282 * @param {!WebInspector.Event} event | |
| 1283 */ | |
| 1284 settingChanged: function(event) | |
| 1285 { | |
| 1286 PageAgent.setScriptExecutionDisabled(event.data, this._updateScriptDisab ledCheckbox.bind(this)); | |
| 1287 }, | |
| 1288 | |
| 1289 /** | |
| 1290 * @override | |
| 1291 * @param {!Element} settingElement | |
| 1292 * @param {!Element} containerElement | |
| 1293 */ | |
| 1294 configure: function(settingElement, containerElement) | |
| 1295 { | |
| 1296 this._disableJSCheckbox = settingElement.getElementsByTagName("input")[0 ]; | |
| 1297 var disableJSInfoParent = this._disableJSCheckbox.parentElement.createCh ild("span", "monospace"); | |
| 1298 this._disableJSInfo = disableJSInfoParent.createChild("span", "object-in fo-state-note hidden"); | |
| 1299 this._disableJSInfo.title = WebInspector.UIString("JavaScript is blocked on the inspected page (may be disabled in browser settings)."); | |
| 1300 | |
| 1301 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre eModel.EventTypes.MainFrameNavigated, this._updateScriptDisabledCheckbox, this); | |
| 1302 this._updateScriptDisabledCheckbox(); | |
| 1303 }, | |
| 1304 | |
| 1305 _updateScriptDisabledCheckbox: function() | |
| 1306 { | |
| 1307 PageAgent.getScriptExecutionStatus(executionStatusCallback.bind(this)); | |
| 1308 | |
| 1309 /** | |
| 1310 * @param {?Protocol.Error} error | |
| 1311 * @param {string} status | |
| 1312 * @this {WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate} | |
| 1313 */ | |
| 1314 function executionStatusCallback(error, status) | |
| 1315 { | |
| 1316 if (error || !status) | |
| 1317 return; | |
| 1318 | |
| 1319 var forbidden = (status === "forbidden"); | |
| 1320 var disabled = forbidden || (status === "disabled"); | |
| 1321 | |
| 1322 this._disableJSInfo.classList.toggle("hidden", !forbidden); | |
| 1323 this._disableJSCheckbox.checked = disabled; | |
| 1324 this._disableJSCheckbox.disabled = forbidden; | |
| 1325 } | |
| 1326 }, | |
| 1327 | |
| 1328 __proto__: WebInspector.UISettingDelegate.prototype | |
| 1329 } | |
| OLD | NEW |