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

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

Issue 2736853002: DevTools: Convert FilteredListWidget to use an optional provider (Closed)
Patch Set: missing timeout Created 3 years, 9 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/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 42625907ff4b813b71a5f25552a3f1c2b02d0902..7d745c4d8f727c1161306cd8d0223b063c35325c 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
@@ -109,10 +109,7 @@ QuickOpen.CommandMenu = class {
}
};
-/**
- * @unrestricted
- */
-QuickOpen.CommandMenuDelegate = class extends QuickOpen.FilteredListWidget.Delegate {
+QuickOpen.CommandMenuProvider = class extends QuickOpen.FilteredListWidget.Provider {
constructor() {
super();
this._commands = [];
@@ -200,8 +197,8 @@ QuickOpen.CommandMenuDelegate = class extends QuickOpen.FilteredListWidget.Deleg
var command = this._commands[itemIndex];
titleElement.removeChildren();
var tagElement = titleElement.createChild('span', 'tag');
- var index = String.hashCode(command.category()) % QuickOpen.CommandMenuDelegate.MaterialPaletteColors.length;
- tagElement.style.backgroundColor = QuickOpen.CommandMenuDelegate.MaterialPaletteColors[index];
+ var index = String.hashCode(command.category()) % QuickOpen.CommandMenuProvider.MaterialPaletteColors.length;
+ tagElement.style.backgroundColor = QuickOpen.CommandMenuProvider.MaterialPaletteColors[index];
tagElement.textContent = command.category();
titleElement.createTextChild(command.title());
QuickOpen.FilteredListWidget.highlightRanges(titleElement, query, true);
@@ -229,7 +226,7 @@ QuickOpen.CommandMenuDelegate = class extends QuickOpen.FilteredListWidget.Deleg
}
};
-QuickOpen.CommandMenuDelegate.MaterialPaletteColors = [
+QuickOpen.CommandMenuProvider.MaterialPaletteColors = [
'#F44336', '#E91E63', '#9C27B0', '#673AB7', '#3F51B5', '#03A9F4', '#00BCD4', '#009688', '#4CAF50', '#8BC34A',
'#CDDC39', '#FFC107', '#FF9800', '#FF5722', '#795548', '#9E9E9E', '#607D8B'
];
@@ -311,7 +308,7 @@ QuickOpen.CommandMenu.ShowActionDelegate = class {
* @return {boolean}
*/
handleAction(context, actionId) {
- new QuickOpen.FilteredListWidget(new QuickOpen.CommandMenuDelegate()).showAsDialog();
+ new QuickOpen.FilteredListWidget(new QuickOpen.CommandMenuProvider()).showAsDialog();
InspectorFrontendHost.bringToFront();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698