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

Unified Diff: Source/devtools/front_end/elements/ElementsPanel.js

Issue 391083003: DevTools: remove Node.reveal() and RemoteOject.reveal() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/ElementsPanel.js
diff --git a/Source/devtools/front_end/elements/ElementsPanel.js b/Source/devtools/front_end/elements/ElementsPanel.js
index 92c9c2e2f3f7f138928e6847de328ff7700f3b4c..df9250effb3ba7703284cf6e5873e2755206ec45 100644
--- a/Source/devtools/front_end/elements/ElementsPanel.js
+++ b/Source/devtools/front_end/elements/ElementsPanel.js
@@ -1218,20 +1218,14 @@ WebInspector.ElementsPanel.prototype = {
*/
appendApplicableItems: function(event, contextMenu, object)
{
- var commandCallback;
- if (object instanceof WebInspector.RemoteObject) {
- var remoteObject = /** @type {!WebInspector.RemoteObject} */ (object);
- if (remoteObject.isNode())
- commandCallback = remoteObject.reveal.bind(remoteObject);
- } else if (object instanceof WebInspector.DOMNode) {
- var domNode = /** @type {!WebInspector.DOMNode} */ (object);
- commandCallback = domNode.reveal.bind(domNode);
- }
- if (!commandCallback)
+ if (!(object instanceof WebInspector.RemoteObject && (/** @type {!WebInspector.RemoteObject} */ (object)).isNode())
+ && !(object instanceof WebInspector.DOMNode)) {
return;
+ }
// Skip adding "Reveal..." menu item for our own tree outline.
if (this.element.isAncestor(/** @type {!Node} */ (event.target)))
return;
+ var commandCallback = WebInspector.Revealer.reveal.bind(WebInspector.Revealer, object);
contextMenu.appendItem(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Elements panel" : "Reveal in Elements Panel", commandCallback);
},
@@ -1460,7 +1454,7 @@ WebInspector.ElementsPanel.NodeRemoteObjectRevealer.prototype = {
function selectNode(remoteObject, node)
{
if (node) {
- node.reveal();
+ WebInspector.Revealer.reveal(node);
return;
}
if (!remoteObject || remoteObject.description !== "#text" || !remoteObject.isNode())
« no previous file with comments | « Source/devtools/front_end/components/DOMPresentationUtils.js ('k') | Source/devtools/front_end/main/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698