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

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

Issue 2566573002: DevTools: Open Elements panel sooner on Inspect Element (Closed)
Patch Set: Created 4 years 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/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 70e071fd4fcbc601aec04896ed575a180c6ca9d8..72616d26ec42c288e1bc795c6e8ef63a80ee8cea 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/View.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/View.js
@@ -380,10 +380,12 @@ UI.ViewManager = class {
* @param {string=} location
* @param {boolean=} restoreSelection
* @param {boolean=} allowReorder
+ * @param {?string=} defaultTab
* @return {!UI.TabbedViewLocation}
*/
- createTabbedLocation(revealCallback, location, restoreSelection, allowReorder) {
- return new UI.ViewManager._TabbedLocation(this, revealCallback, location, restoreSelection, allowReorder);
+ createTabbedLocation(revealCallback, location, restoreSelection, allowReorder, defaultTab) {
+ return new UI.ViewManager._TabbedLocation(
+ this, revealCallback, location, restoreSelection, allowReorder, defaultTab);
}
/**
@@ -565,8 +567,9 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
* @param {string=} location
* @param {boolean=} restoreSelection
* @param {boolean=} allowReorder
+ * @param {?string=} defaultTab
*/
- constructor(manager, revealCallback, location, restoreSelection, allowReorder) {
+ constructor(manager, revealCallback, location, restoreSelection, allowReorder, defaultTab) {
var tabbedPane = new UI.TabbedPane();
if (allowReorder)
tabbedPane.setAllowTabReorder(true);
@@ -582,6 +585,7 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabOrderChanged, this._persistTabOrder, this);
if (restoreSelection)
this._lastSelectedTabSetting = Common.settings.createSetting(location + '-selectedTab', '');
+ this._defaultTab = defaultTab;
/** @type {!Map.<string, !UI.View>} */
this._views = new Map();
@@ -640,7 +644,9 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
else if (this._closeableTabSetting.get()[id])
this._appendTab(view);
}
- if (this._lastSelectedTabSetting && this._tabbedPane.hasTab(this._lastSelectedTabSetting.get()))
+ if (this._defaultTab && this._tabbedPane.hasTab(this._defaultTab))
+ this._tabbedPane.selectTab(this._defaultTab);
+ else if (this._lastSelectedTabSetting && this._tabbedPane.hasTab(this._lastSelectedTabSetting.get()))
this._tabbedPane.selectTab(this._lastSelectedTabSetting.get());
}

Powered by Google App Engine
This is Rietveld 408576698