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

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

Issue 2625873003: DevTools: Move history handling into FilteredListWidget from the delegate (Closed)
Patch Set: Fix test 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 QuickOpen.CommandMenu = class { 7 QuickOpen.CommandMenu = class {
8 constructor() { 8 constructor() {
9 this._commands = []; 9 this._commands = [];
10 this._loadCommands(); 10 this._loadCommands();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 commands() { 123 commands() {
124 return this._commands; 124 return this._commands;
125 } 125 }
126 }; 126 };
127 127
128 /** 128 /**
129 * @unrestricted 129 * @unrestricted
130 */ 130 */
131 QuickOpen.CommandMenuDelegate = class extends QuickOpen.FilteredListWidget.Deleg ate { 131 QuickOpen.CommandMenuDelegate = class extends QuickOpen.FilteredListWidget.Deleg ate {
132 constructor() { 132 constructor() {
133 super([]); 133 super();
134 this._commands = []; 134 this._commands = [];
135 this._appendAvailableCommands(); 135 this._appendAvailableCommands();
136 } 136 }
137 137
138 _appendAvailableCommands() { 138 _appendAvailableCommands() {
139 var allCommands = QuickOpen.commandMenu.commands(); 139 var allCommands = QuickOpen.commandMenu.commands();
140 140
141 // Populate whitelisted actions. 141 // Populate whitelisted actions.
142 var actions = UI.actionRegistry.availableActions(); 142 var actions = UI.actionRegistry.availableActions();
143 for (var action of actions) { 143 for (var action of actions) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 * @param {!UI.Context} context 332 * @param {!UI.Context} context
333 * @param {string} actionId 333 * @param {string} actionId
334 * @return {boolean} 334 * @return {boolean}
335 */ 335 */
336 handleAction(context, actionId) { 336 handleAction(context, actionId) {
337 new QuickOpen.FilteredListWidget(new QuickOpen.CommandMenuDelegate()).showAs Dialog(); 337 new QuickOpen.FilteredListWidget(new QuickOpen.CommandMenuDelegate()).showAs Dialog();
338 InspectorFrontendHost.bringToFront(); 338 InspectorFrontendHost.bringToFront();
339 return true; 339 return true;
340 } 340 }
341 }; 341 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698