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

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

Issue 2617293002: DevTools: TabbedLocations only materialize tabs when needed (Closed)
Patch Set: rework for TabbedLocations 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 | « third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js ('k') | 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/View.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/View.js b/third_party/WebKit/Source/devtools/front_end/ui/View.js
index a0eef03dbb35105eaa0eb06bb677515113e6c789..e17e6e3090e82ea793d23a3304b63824716e2fba 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/View.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/View.js
@@ -578,6 +578,7 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
this._closeableTabSetting = Common.settings.createSetting(location + '-closeableTabs', {});
this._tabOrderSetting = Common.settings.createSetting(location + '-tabOrder', {});
this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabOrderChanged, this._persistTabOrder, this);
+ this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabsShown, this._tabsShown, this);
if (restoreSelection)
this._lastSelectedTabSetting = Common.settings.createSetting(location + '-selectedTab', '');
this._defaultTab = defaultTab;
@@ -737,7 +738,8 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
if (!view)
return;
- this._materializeWidget(view);
+ if (this._tabbedPane.isShowing())
+ this._materializeWidget(view);
if (view.isCloseable()) {
var tabs = this._closeableTabSetting.get();
@@ -751,6 +753,16 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
/**
* @param {!Common.Event} event
*/
+ _tabsShown(event) {
dgozman 2017/01/10 21:51:45 We can instead materialize when our wrapper (UI.Vi
luoe 2017/01/10 23:15:17 Brilliant idea
+ var view = event.data ? this._views.get(event.data.id) : null;
+ if (!view)
+ return;
+ this._materializeWidget(view);
+ }
+
+ /**
+ * @param {!Common.Event} event
+ */
_tabClosed(event) {
var id = /** @type {string} */ (event.data['tabId']);
var tabs = this._closeableTabSetting.get();
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698