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

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

Issue 2412023002: DevTools: migrate InspectorView to tabbed view location. (Closed)
Patch Set: made layers panel closeable. Created 4 years, 2 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: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
index 3ec933eda2f56b4f666a434c63a02c61651b45b4..3686992e756f08f1dacd49923786a4e897233559 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -507,8 +507,7 @@ WebInspector.ElementsPanel.prototype = {
{
// Reset search restore.
this._searchableView.cancelSearch();
- WebInspector.inspectorView.setCurrentPanel(this);
- this.selectDOMNode(node, true);
+ WebInspector.viewManager.showView("elements").then(() => this.selectDOMNode(node, true));
},
/**
@@ -776,6 +775,7 @@ WebInspector.ElementsPanel.prototype = {
/**
* @param {!WebInspector.DOMNode} node
+ * @return {!Promise}
*/
revealAndSelectNode: function(node)
{
@@ -784,18 +784,17 @@ WebInspector.ElementsPanel.prototype = {
this._omitDefaultSelection = true;
- var showLayoutEditor = !!WebInspector.inspectElementModeController && WebInspector.inspectElementModeController.isInLayoutEditorMode();
- WebInspector.inspectorView.setCurrentPanel(this, showLayoutEditor);
node = WebInspector.moduleSetting("showUAShadowDOM").get() ? node : this._leaveUserAgentShadowDOM(node);
- if (!showLayoutEditor)
- node.highlightForTwoSeconds();
+ node.highlightForTwoSeconds();
- this.selectDOMNode(node, true);
- delete this._omitDefaultSelection;
+ return WebInspector.viewManager.showView("elements").then(() => {
+ this.selectDOMNode(node, true);
+ delete this._omitDefaultSelection;
- if (!this._notFirstInspectElement)
- InspectorFrontendHost.inspectElementCompleted();
- this._notFirstInspectElement = true;
+ if (!this._notFirstInspectElement)
+ InspectorFrontendHost.inspectElementCompleted();
+ this._notFirstInspectElement = true;
+ });
},
_sidebarContextMenuEventFired: function(event)
@@ -873,7 +872,7 @@ WebInspector.ElementsPanel.prototype = {
showMetrics.call(this, false);
}
- this.sidebarPaneView = WebInspector.viewManager.createTabbedLocation(() => WebInspector.inspectorView.setCurrentPanel(this));
+ this.sidebarPaneView = WebInspector.viewManager.createTabbedLocation(() => WebInspector.viewManager.showView("elements"));
var tabbedPane = this.sidebarPaneView.tabbedPane();
tabbedPane.element.addEventListener("contextmenu", this._sidebarContextMenuEventFired.bind(this), false);
if (this._popoverHelper)
@@ -1027,8 +1026,7 @@ WebInspector.ElementsPanel.DOMNodeRevealer.prototype = {
panel._pendingNodeReveal = false;
if (resolvedNode) {
- panel.revealAndSelectNode(resolvedNode);
- resolve(undefined);
+ panel.revealAndSelectNode(resolvedNode).then(resolve);
return;
}
reject(new Error("Could not resolve node to reveal."));
@@ -1056,11 +1054,6 @@ WebInspector.ElementsPanel.CSSPropertyRevealer.prototype = {
}
}
-WebInspector.ElementsPanel.show = function()
-{
- WebInspector.inspectorView.setCurrentPanel(WebInspector.ElementsPanel.instance());
-}
-
/**
* @return {!WebInspector.ElementsPanel}
*/

Powered by Google App Engine
This is Rietveld 408576698