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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/SettingsUI.js ('k') | Source/devtools/front_end/helpScreen.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate.prototype = { 1232 WebInspector.SourcesPanel.ShowGoToSourceDialogActionDelegate.prototype = {
1233 /** 1233 /**
1234 * @return {boolean} 1234 * @return {boolean}
1235 */ 1235 */
1236 handleAction: function() 1236 handleAction: function()
1237 { 1237 {
1238 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.sh owPanel("sources")).showGoToSourceDialog(); 1238 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.sh owPanel("sources")).showGoToSourceDialog();
1239 return true; 1239 return true;
1240 } 1240 }
1241 } 1241 }
1242
1243 /**
1244 * @constructor
1245 * @extends {WebInspector.UISettingDelegate}
1246 */
1247 WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate = function()
1248 {
1249 WebInspector.UISettingDelegate.call(this);
1250 }
1251
1252 WebInspector.SourcesPanel.SkipStackFramePatternSettingDelegate.prototype = {
1253 /**
1254 * @override
1255 * @return {!Element}
1256 */
1257 settingElement: function()
1258 {
1259 return WebInspector.SettingsUI.createSettingInputField(WebInspector.UISt ring("Pattern"), WebInspector.settings.skipStackFramesPattern, false, 1000, "100 px", WebInspector.SettingsUI.regexValidator);
1260 },
1261
1262 __proto__: WebInspector.UISettingDelegate.prototype
1263 }
1264
1265 /**
1266 * @constructor
1267 * @extends {WebInspector.UISettingDelegate}
1268 */
1269 WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate = function()
1270 {
1271 WebInspector.UISettingDelegate.call(this);
1272 }
1273
1274 WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate.prototype = {
1275 /**
1276 * @override
1277 * @return {!Element}
1278 */
1279 settingElement: function()
1280 {
1281 var disableJSElement = WebInspector.SettingsUI.createSettingCheckbox(Web Inspector.UIString("Disable JavaScript"), WebInspector.settings.javaScriptDisabl ed);
1282 this._disableJSCheckbox = disableJSElement.getElementsByTagName("input") [0];
1283 WebInspector.settings.javaScriptDisabled.addChangeListener(this._setting Changed, this);
1284 var disableJSInfoParent = this._disableJSCheckbox.parentElement.createCh ild("span", "monospace");
1285 this._disableJSInfo = disableJSInfoParent.createChild("span", "object-in fo-state-note hidden");
1286 this._disableJSInfo.title = WebInspector.UIString("JavaScript is blocked on the inspected page (may be disabled in browser settings).");
1287
1288 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre eModel.EventTypes.MainFrameNavigated, this._updateScriptDisabledCheckbox, this);
1289 this._updateScriptDisabledCheckbox();
1290 return disableJSElement;
1291 },
1292
1293 /**
1294 * @param {!WebInspector.Event} event
1295 */
1296 _settingChanged: function(event)
1297 {
1298 PageAgent.setScriptExecutionDisabled(event.data, this._updateScriptDisab ledCheckbox.bind(this));
1299 },
1300
1301 _updateScriptDisabledCheckbox: function()
1302 {
1303 PageAgent.getScriptExecutionStatus(executionStatusCallback.bind(this));
1304
1305 /**
1306 * @param {?Protocol.Error} error
1307 * @param {string} status
1308 * @this {WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate}
1309 */
1310 function executionStatusCallback(error, status)
1311 {
1312 if (error || !status)
1313 return;
1314
1315 var forbidden = (status === "forbidden");
1316 var disabled = forbidden || (status === "disabled");
1317
1318 this._disableJSInfo.classList.toggle("hidden", !forbidden);
1319 this._disableJSCheckbox.checked = disabled;
1320 this._disableJSCheckbox.disabled = forbidden;
1321 }
1322 },
1323
1324 __proto__: WebInspector.UISettingDelegate.prototype
1325 }
OLDNEW
« 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