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

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

Issue 2205123003: DevTools: introduce view locations, allow opening views by id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixed Created 4 years, 4 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/ui/TabbedPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
index 5b5e5300ad7f5a07df73d961b7317a98dc3b8b28..7f189faccfe3509a661e0bb7015a81abf6249014 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
@@ -1268,6 +1268,7 @@ WebInspector.TabbedPaneTabDelegate.prototype = {
/**
* @constructor
* @extends {WebInspector.VBox}
+ * @implements {WebInspector.ViewLocation}
* @param {string} location
* @param {boolean=} restoreSelection
*/
@@ -1308,7 +1309,7 @@ WebInspector.ExtensibleTabbedPane.prototype = {
var location = extensions[i].descriptor()["location"];
if (location !== this._location)
continue;
- var id = extensions[i].descriptor()["name"];
+ var id = extensions[i].descriptor()["id"];
this._extensions.set(id, extensions[i]);
if (this._isPermanentTab(id))
this._appendTab(extensions[i]);
@@ -1362,7 +1363,7 @@ WebInspector.ExtensibleTabbedPane.prototype = {
if (extension.descriptor()["location"] !== this._location)
continue;
var title = WebInspector.UIString(extension.title());
- contextMenu.appendItem(title, this.showTab.bind(this, extension.descriptor()["name"]));
+ contextMenu.appendItem(title, this.showView.bind(this, extension.descriptor()["id"]));
}
},
@@ -1372,19 +1373,21 @@ WebInspector.ExtensibleTabbedPane.prototype = {
_appendTab: function(extension)
{
var descriptor = extension.descriptor();
- var id = descriptor["name"];
+ var id = descriptor["id"];
var title = WebInspector.UIString(extension.title());
var closeable = descriptor["persistence"] === "closeable" || descriptor["persistence"] === "temporary";
this._tabbedPane.appendTab(id, title, new WebInspector.Widget(), undefined, false, closeable);
},
/**
+ * @override
* @param {string} id
*/
- showTab: function(id)
+ showView: function(id)
{
if (!this._tabbedPane.hasTab(id))
this._appendTab(/** @type {!Runtime.Extension} */(this._extensions.get(id)));
+ this._tabbedPane.focus();
this._tabbedPane.selectTab(id);
},

Powered by Google App Engine
This is Rietveld 408576698