diff options
author | kaznacheev@chromium.org <kaznacheev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 10:46:36 +0000 |
---|---|---|
committer | kaznacheev@chromium.org <kaznacheev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 10:46:36 +0000 |
commit | 3528b7d649dd8efa672dac02a5c9fde3190cbeb1 (patch) | |
tree | 859fe04d8201bd7297714a701f563a0e5e94481a /ash | |
parent | 2b6fe01fb5686449a4b1dff5a80cde6667df6f2c (diff) | |
download | chromium_src-3528b7d649dd8efa672dac02a5c9fde3190cbeb1.zip chromium_src-3528b7d649dd8efa672dac02a5c9fde3190cbeb1.tar.gz chromium_src-3528b7d649dd8efa672dac02a5c9fde3190cbeb1.tar.bz2 |
Respect user-selected launch type (tab/window/fullscreen) when opening File Manager via Ctrl+M
Also made Ctrl+M work when there are no browser windows.
BUG=chromium-os:27884
TEST=On the Apps screen select "Open as window", press Ctrl+M, File Manager should open in a new window. Same with tab/pinned tab/fullscreen.
Review URL: http://codereview.chromium.org/10091041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 10 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.cc | 2 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.h | 1 | ||||
-rw-r--r-- | ash/shell/shell_delegate_impl.cc | 3 | ||||
-rw-r--r-- | ash/shell/shell_delegate_impl.h | 1 | ||||
-rw-r--r-- | ash/shell_delegate.h | 3 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.cc | 3 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.h | 1 |
8 files changed, 24 insertions, 0 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index c16958d..a72c7d2 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -116,6 +116,14 @@ bool HandleLock() { delegate->LockScreen(); return true; } + +bool HandleFileManager() { + ash::ShellDelegate* delegate = ash::Shell::GetInstance()->delegate(); + if (!delegate) + return false; + delegate->OpenFileManager(); + return true; +} #endif bool HandleExit() { @@ -336,6 +344,8 @@ bool AcceleratorController::AcceleratorPressed( #if defined(OS_CHROMEOS) case LOCK_SCREEN: return HandleLock(); + case OPEN_FILE_MANAGER: + return HandleFileManager(); #endif case EXIT: return HandleExit(); diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc index 5c07556..e7a4630 100644 --- a/ash/accelerators/accelerator_table.cc +++ b/ash/accelerators/accelerator_table.cc @@ -37,6 +37,8 @@ const AcceleratorData kAcceleratorData[] = { { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_BRIGHTNESS_UP, false, false, false, BRIGHTNESS_UP }, { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_L, true, true, false, LOCK_SCREEN }, + { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_M, false, true, false, + OPEN_FILE_MANAGER }, #endif { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_Q, true, true, false, EXIT }, { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_N, true, true, false, diff --git a/ash/accelerators/accelerator_table.h b/ash/accelerators/accelerator_table.h index d28b6fc..a960eee 100644 --- a/ash/accelerators/accelerator_table.h +++ b/ash/accelerators/accelerator_table.h @@ -34,6 +34,7 @@ enum AcceleratorAction { FOCUS_TRAY, #if defined(OS_CHROMEOS) LOCK_SCREEN, + OPEN_FILE_MANAGER, #endif SELECT_WIN_0, SELECT_WIN_1, diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc index 78e3325..334e597 100644 --- a/ash/shell/shell_delegate_impl.cc +++ b/ash/shell/shell_delegate_impl.cc @@ -49,6 +49,9 @@ bool ShellDelegateImpl::IsScreenLocked() const { return locked_; } +void ShellDelegateImpl::OpenFileManager() { +} + void ShellDelegateImpl::Exit() { MessageLoopForUI::current()->Quit(); } diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h index 9c0e403..b0709f6 100644 --- a/ash/shell/shell_delegate_impl.h +++ b/ash/shell/shell_delegate_impl.h @@ -26,6 +26,7 @@ class ShellDelegateImpl : public ash::ShellDelegate { virtual void LockScreen() OVERRIDE; virtual void UnlockScreen() OVERRIDE; virtual bool IsScreenLocked() const OVERRIDE; + virtual void OpenFileManager() OVERRIDE; virtual void Exit() OVERRIDE; virtual void NewWindow(bool incognito) OVERRIDE; virtual ash::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE; diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index 813ed18..bf687fd 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h @@ -50,6 +50,9 @@ class ASH_EXPORT ShellDelegate { // Returns true if the screen is currently locked. virtual bool IsScreenLocked() const = 0; + // Invoked when a user uses Ctrl-M to open file manager. + virtual void OpenFileManager() = 0; + // Invoked when a user uses Ctrl-Shift-Q to close chrome. virtual void Exit() = 0; diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index 04469ab..dfb1112 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -37,6 +37,9 @@ bool TestShellDelegate::IsScreenLocked() const { return locked_; } +void TestShellDelegate::OpenFileManager() { +} + void TestShellDelegate::Exit() { } diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h index 5d507c4..0751126 100644 --- a/ash/test/test_shell_delegate.h +++ b/ash/test/test_shell_delegate.h @@ -22,6 +22,7 @@ class TestShellDelegate : public ShellDelegate { virtual void LockScreen() OVERRIDE; virtual void UnlockScreen() OVERRIDE; virtual bool IsScreenLocked() const OVERRIDE; + virtual void OpenFileManager() OVERRIDE; virtual void Exit() OVERRIDE; virtual void NewWindow(bool incognito) OVERRIDE; virtual AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE; |