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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js

Issue 2617293002: DevTools: TabbedLocations only materialize tabs when needed (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
index 51292fb948ea6522f66e0aad41934a33f9e05622..8015df791b528a59552ff6f6ace7ef0e6f32436b 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
@@ -43,18 +43,9 @@ UI.InspectorView = class extends UI.VBox {
this._drawerSplitWidget.hideDefaultResizer();
this._drawerSplitWidget.enableShowModeSaving();
this._drawerSplitWidget.show(this.element);
-
- // Create drawer tabbed pane.
- this._drawerTabbedLocation =
- UI.viewManager.createTabbedLocation(this._showDrawer.bind(this, false), 'drawer-view', true);
- this._drawerTabbedLocation.enableMoreTabsButton();
- this._drawerTabbedPane = this._drawerTabbedLocation.tabbedPane();
- this._drawerTabbedPane.setMinimumSize(0, 27);
- var closeDrawerButton = new UI.ToolbarButton(Common.UIString('Close drawer'), 'largeicon-delete');
- closeDrawerButton.addEventListener(UI.ToolbarButton.Events.Click, this._closeDrawer, this);
- this._drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton);
- this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement());
- this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane);
+ this._drawerBuilt = false;
einbinder 2017/01/07 11:51:59 What is this used for?
+ if (this._drawerSplitWidget.showMode() === UI.SplitWidget.ShowMode.Both)
+ this._drawerLocation();
// Create main area tabbed pane.
this._tabbedLocation = UI.viewManager.createTabbedLocation(
@@ -110,7 +101,7 @@ UI.InspectorView = class extends UI.VBox {
* @return {?UI.ViewLocation}
*/
resolveLocation(locationName) {
- return this._drawerTabbedLocation;
+ return this._drawerLocation();
}
createToolbars() {
@@ -182,15 +173,32 @@ UI.InspectorView = class extends UI.VBox {
return /** @type {!UI.Panel} */ (UI.viewManager.materializedWidget(this._tabbedPane.selectedTabId || ''));
}
+ _drawerLocation() {
einbinder 2017/01/07 11:51:59 jsdoc @return
+ if (this._drawerTabbedLocation)
+ return this._drawerTabbedLocation;
+ this._drawerBuilt = true;
+ this._drawerTabbedLocation =
einbinder 2017/01/07 11:51:59 jsdoc @type this in constructor
+ UI.viewManager.createTabbedLocation(this._showDrawer.bind(this, false), 'drawer-view', true);
+ this._drawerTabbedLocation.enableMoreTabsButton();
+ this._drawerTabbedPane = this._drawerTabbedLocation.tabbedPane();
einbinder 2017/01/07 11:51:59 var drawerTabbedPane =
+ this._drawerTabbedPane.setMinimumSize(0, 27);
+ var closeDrawerButton = new UI.ToolbarButton(Common.UIString('Close drawer'), 'largeicon-delete');
+ closeDrawerButton.addEventListener(UI.ToolbarButton.Events.Click, this._closeDrawer, this);
+ this._drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton);
+ this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement());
+ this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane);
+ return this._drawerTabbedLocation;
+ }
+
/**
* @param {boolean} focus
*/
_showDrawer(focus) {
- if (this._drawerTabbedPane.isShowing())
+ if (this._drawerLocation().tabbedPane().isShowing())
return;
this._drawerSplitWidget.showBoth();
if (focus)
- this._focusRestorer = new UI.WidgetFocusRestorer(this._drawerTabbedPane);
+ this._focusRestorer = new UI.WidgetFocusRestorer(this._drawerLocation().tabbedPane());
else
this._focusRestorer = null;
}
@@ -199,11 +207,11 @@ UI.InspectorView = class extends UI.VBox {
* @return {boolean}
*/
drawerVisible() {
- return this._drawerTabbedPane.isShowing();
+ return this._drawerLocation().tabbedPane().isShowing();
einbinder 2017/01/07 11:51:59 !!this._drawerTabbedLocation && this._drawerLocati
}
_closeDrawer() {
- if (!this._drawerTabbedPane.isShowing())
+ if (!this._drawerLocation().tabbedPane().isShowing())
einbinder 2017/01/07 11:51:59 !!this._drawerTabbedLocation && this._drawerLocati
return;
if (this._focusRestorer)
this._focusRestorer.restore();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698