Commit d8c4c1cc authored by Pavel Feldman's avatar Pavel Feldman Committed by Commit Bot

DevTools: make 'show console' shortcut work when inspected page has focus.

Bug: 144943
Change-Id: I853906bbc9be8774e154e6454cf4166ae08daa3b
Reviewed-on: https://chromium-review.googlesource.com/562321Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485020}
parent c923b817
...@@ -1337,6 +1337,7 @@ Console.ConsoleView.ActionDelegate = class { ...@@ -1337,6 +1337,7 @@ Console.ConsoleView.ActionDelegate = class {
handleAction(context, actionId) { handleAction(context, actionId) {
switch (actionId) { switch (actionId) {
case 'console.show': case 'console.show':
InspectorFrontendHost.bringToFront();
Common.console.show(); Common.console.show();
return true; return true;
case 'console.clear': case 'console.clear':
......
...@@ -311,8 +311,10 @@ Main.Main = class { ...@@ -311,8 +311,10 @@ Main.Main = class {
} }
_registerForwardedShortcuts() { _registerForwardedShortcuts() {
/** @const */ var forwardedActions = /** @const */ var forwardedActions = [
['main.toggle-dock', 'debugger.toggle-breakpoints-active', 'debugger.toggle-pause', 'commandMenu.show']; 'main.toggle-dock', 'debugger.toggle-breakpoints-active', 'debugger.toggle-pause', 'commandMenu.show',
'console.show'
];
var actionKeys = var actionKeys =
UI.shortcutRegistry.keysForActions(forwardedActions).map(UI.KeyboardShortcut.keyCodeAndModifiersFromKey); UI.shortcutRegistry.keysForActions(forwardedActions).map(UI.KeyboardShortcut.keyCodeAndModifiersFromKey);
InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys)); InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys));
......
...@@ -312,6 +312,7 @@ QuickOpen.CommandMenu.ShowActionDelegate = class { ...@@ -312,6 +312,7 @@ QuickOpen.CommandMenu.ShowActionDelegate = class {
* @return {boolean} * @return {boolean}
*/ */
handleAction(context, actionId) { handleAction(context, actionId) {
InspectorFrontendHost.bringToFront();
QuickOpen.QuickOpen.show('>'); QuickOpen.QuickOpen.show('>');
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment