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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 9297008: [HTerm-Crosh] Add key shortcut for opening Crosh on ChromeOS Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pass GURL to OpenNewTab Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/ash.gyp » ('j') | chrome/browser/extensions/api/terminal/terminal_extension_helper.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 47d0a6b7f9e4a512a5dfedcd821cb5740e7f8631..0872bee5b9e3162e3678d52f115bfba888dd0526 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -10,8 +10,10 @@
#include "ash/screenshot_delegate.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
+#include "ash/shell_url_constants.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/window_cycle_controller.h"
+#include "googleurl/src/gurl.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
#include "ui/base/accelerators/accelerator.h"
@@ -28,6 +30,7 @@ enum AcceleratorAction {
CYCLE_FORWARD,
#if defined(OS_CHROMEOS)
LOCK_SCREEN,
+ OPEN_CROSH_TAB,
#endif
EXIT,
TAKE_SCREENSHOT,
@@ -53,6 +56,7 @@ struct AcceleratorData {
{ ui::VKEY_F5, false, false, false, CYCLE_FORWARD },
#if defined(OS_CHROMEOS)
{ ui::VKEY_L, true, true, false, LOCK_SCREEN },
+ { ui::VKEY_T, false, true, true, OPEN_CROSH_TAB },
#endif
{ ui::VKEY_Q, true, true, false, EXIT },
{ ui::VKEY_F5, true, false, false, CYCLE_BACKWARD },
@@ -87,6 +91,14 @@ bool HandleLock() {
delegate->LockScreen();
return true;
}
+
+bool HandleOpenCrosh() {
+ ash::ShellDelegate* delegate = ash::Shell::GetInstance()->delegate();
+ if (!delegate)
+ return false;
+ delegate->OpenNewTab(GURL(ash::kAuraTerminalURL));
+ return true;
+}
#endif
bool HandleExit() {
@@ -226,6 +238,8 @@ bool AcceleratorController::AcceleratorPressed(
#if defined(OS_CHROMEOS)
case LOCK_SCREEN:
return HandleLock();
+ case OPEN_CROSH_TAB:
+ return HandleOpenCrosh();
#endif
case EXIT:
return HandleExit();
« no previous file with comments | « no previous file | ash/ash.gyp » ('j') | chrome/browser/extensions/api/terminal/terminal_extension_helper.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698