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

Side by Side Diff: Source/devtools/front_end/elements/ElementsPanel.js

Issue 1310273006: Devtools: convert pair of booleans in setInspectModeEnabled into enum parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments Created 5 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 continue; 1109 continue;
1110 1110
1111 var treeOutline = /** @type {!WebInspector.ElementsTreeOutline} */(t his._modelToTreeOutline.get(domModel)); 1111 var treeOutline = /** @type {!WebInspector.ElementsTreeOutline} */(t his._modelToTreeOutline.get(domModel));
1112 if (this._showLayoutEditor) 1112 if (this._showLayoutEditor)
1113 domModel.setHighlighter(new WebInspector.ElementsPanel.LayoutEdi torNodeHighlighter(target, treeOutline)); 1113 domModel.setHighlighter(new WebInspector.ElementsPanel.LayoutEdi torNodeHighlighter(target, treeOutline));
1114 else 1114 else
1115 domModel.setHighlighter(null); 1115 domModel.setHighlighter(null);
1116 1116
1117 // We need to correct (turn on/off layout editor) the config which i s used by inspect element mode, so we re-enable it. 1117 // We need to correct (turn on/off layout editor) the config which i s used by inspect element mode, so we re-enable it.
1118 if (WebInspector.inspectElementModeController && WebInspector.inspec tElementModeController.enabled()) 1118 if (WebInspector.inspectElementModeController && WebInspector.inspec tElementModeController.enabled())
1119 domModel.setInspectModeEnabled(true, WebInspector.moduleSetting( "showUAShadowDOM").get()); 1119 domModel.setInspectMode(WebInspector.moduleSetting("showUAShadow DOM").get() ? DOMAgent.InspectMode.SearchForUAShadowDOM : DOMAgent.InspectMode.S earchForNode);
1120 } 1120 }
1121 WebInspector.DOMModel.hideDOMNodeHighlight(); 1121 WebInspector.DOMModel.hideDOMNodeHighlight();
1122 }, 1122 },
1123 1123
1124 __proto__: WebInspector.Panel.prototype 1124 __proto__: WebInspector.Panel.prototype
1125 } 1125 }
1126 1126
1127 /** 1127 /**
1128 * @constructor 1128 * @constructor
1129 * @implements {WebInspector.ContextMenu.Provider} 1129 * @implements {WebInspector.ContextMenu.Provider}
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 config.showLayoutEditor = config.showInfo; 1326 config.showLayoutEditor = config.showInfo;
1327 var selectedNode = this._treeOutline.selectedDOMNode(); 1327 var selectedNode = this._treeOutline.selectedDOMNode();
1328 if (objectId || node || backendNodeId || !selectedNode) 1328 if (objectId || node || backendNodeId || !selectedNode)
1329 WebInspector.DefaultDOMNodeHighlighter.prototype.highlightDOMNode.ca ll(this, node, config, backendNodeId, objectId); 1329 WebInspector.DefaultDOMNodeHighlighter.prototype.highlightDOMNode.ca ll(this, node, config, backendNodeId, objectId);
1330 else 1330 else
1331 WebInspector.DefaultDOMNodeHighlighter.prototype.highlightDOMNode.ca ll(this, selectedNode, config); 1331 WebInspector.DefaultDOMNodeHighlighter.prototype.highlightDOMNode.ca ll(this, selectedNode, config);
1332 }, 1332 },
1333 1333
1334 /** 1334 /**
1335 * @override 1335 * @override
1336 * @param {boolean} enabled 1336 * @param {!DOMAgent.InspectMode} mode
1337 * @param {boolean} inspectUAShadowDOM
1338 * @param {!DOMAgent.HighlightConfig} config 1337 * @param {!DOMAgent.HighlightConfig} config
1339 * @param {function(?Protocol.Error)=} callback 1338 * @param {function(?Protocol.Error)=} callback
1340 */ 1339 */
1341 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) 1340 setInspectMode: function(mode, config, callback)
1342 { 1341 {
1343 config.showLayoutEditor = config.showInfo; 1342 config.showLayoutEditor = config.showInfo;
1344 WebInspector.DefaultDOMNodeHighlighter.prototype.setInspectModeEnabled.c all(this, enabled, inspectUAShadowDOM, config, callback); 1343 WebInspector.DefaultDOMNodeHighlighter.prototype.setInspectMode.call(thi s, mode, config, callback);
1345 1344
1346 if (enabled) 1345 if (mode !== DOMAgent.InspectMode.None)
1347 return; 1346 return;
1348 1347
1349 var selectedNode = this._treeOutline.selectedDOMNode(); 1348 var selectedNode = this._treeOutline.selectedDOMNode();
1350 if (selectedNode) 1349 if (selectedNode)
1351 WebInspector.DefaultDOMNodeHighlighter.prototype.highlightDOMNode.ca ll(this, selectedNode, config); 1350 WebInspector.DefaultDOMNodeHighlighter.prototype.highlightDOMNode.ca ll(this, selectedNode, config);
1352 }, 1351 },
1353 1352
1354 __proto__: WebInspector.DefaultDOMNodeHighlighter.prototype 1353 __proto__: WebInspector.DefaultDOMNodeHighlighter.prototype
1355 } 1354 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698