| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |