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

Unified Diff: third_party/WebKit/Source/devtools/front_end/quick_open/CommandMenu.js

Issue 2721723002: DevTools: Restore show panel commands in CommandMenu (Closed)
Patch Set: Test Created 3 years, 10 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/LayoutTests/inspector/quick-open/command-menu-expected.txt ('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/quick_open/CommandMenu.js
diff --git a/third_party/WebKit/Source/devtools/front_end/quick_open/CommandMenu.js b/third_party/WebKit/Source/devtools/front_end/quick_open/CommandMenu.js
index 7867bf02655323ee945060387fa13c2fd0162b85..9f11fdd52976fd9e62b1bd202501e7e48e0e9690 100644
--- a/third_party/WebKit/Source/devtools/front_end/quick_open/CommandMenu.js
+++ b/third_party/WebKit/Source/devtools/front_end/quick_open/CommandMenu.js
@@ -62,22 +62,11 @@ QuickOpen.CommandMenu = class {
* @return {!QuickOpen.CommandMenu.Command}
*/
static createRevealPanelCommand(extension) {
- var panelName = extension.descriptor()['name'];
+ var panelId = extension.descriptor()['id'];
+ var executeHandler = UI.viewManager.showView.bind(UI.viewManager, panelId);
var tags = extension.descriptor()['tags'] || '';
return QuickOpen.CommandMenu.createCommand(
- Common.UIString('Panel'), tags, Common.UIString('Show %s', extension.title()), '', executeHandler,
- availableHandler);
-
- /**
- * @return {boolean}
- */
- function availableHandler() {
- return true;
- }
-
- function executeHandler() {
- UI.viewManager.showView(panelName);
- }
+ Common.UIString('Panel'), tags, Common.UIString('Show %s', extension.title()), '', executeHandler);
}
/**
@@ -93,17 +82,12 @@ QuickOpen.CommandMenu = class {
}
_loadCommands() {
- // Populate panels.
- var panelExtensions = self.runtime.extensions(UI.Panel);
- for (var extension of panelExtensions)
- this._commands.push(QuickOpen.CommandMenu.createRevealPanelCommand(extension));
-
- // Populate drawers.
- var drawerExtensions = self.runtime.extensions('view');
- for (var extension of drawerExtensions) {
- if (extension.descriptor()['location'] !== 'drawer-view')
- continue;
- this._commands.push(QuickOpen.CommandMenu.createRevealDrawerCommand(extension));
+ var viewExtensions = self.runtime.extensions('view');
+ for (var extension of viewExtensions) {
+ if (extension.descriptor()['location'] === 'panel')
+ this._commands.push(QuickOpen.CommandMenu.createRevealPanelCommand(extension));
+ else if (extension.descriptor()['location'] === 'drawer-view')
+ this._commands.push(QuickOpen.CommandMenu.createRevealDrawerCommand(extension));
}
// Populate whitelisted settings.
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/quick-open/command-menu-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698