diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 22:50:13 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 22:50:13 +0000 |
commit | 02dbd1a5cee5ea3df9ec09dfcba4400e170c8962 (patch) | |
tree | bac2c69d9322595af20ce450abc23717cc3665a8 /ash/accelerators | |
parent | bde0e4fc9eb40a768c8fb94d8aae1a95288f2499 (diff) | |
download | chromium_src-02dbd1a5cee5ea3df9ec09dfcba4400e170c8962.zip chromium_src-02dbd1a5cee5ea3df9ec09dfcba4400e170c8962.tar.gz chromium_src-02dbd1a5cee5ea3df9ec09dfcba4400e170c8962.tar.bz2 |
Don't check NULL for ShellDelegate.
This is fixed in r165239 and it's guaranteed not to be NULL now.
BUG=159693
TEST=none all tests should pass.
Review URL: https://chromiumcodereview.appspot.com/11377063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/accelerators')
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 6edc1ea..c37a883 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -135,37 +135,6 @@ void HandleSwapPrimaryDisplay() { #endif // defined(OS_CHROMEOS) -bool HandleExit() { - ShellDelegate* delegate = Shell::GetInstance()->delegate(); - if (!delegate) - return false; - delegate->Exit(); - return true; -} - -bool HandleNewTab() { - Shell::GetInstance()->delegate()->NewTab(); - return true; -} - -bool HandleNewWindow(bool is_incognito) { - ShellDelegate* delegate = Shell::GetInstance()->delegate(); - if (!delegate) - return false; - delegate->NewWindow(is_incognito); - return true; -} - -bool HandleRestoreTab() { - Shell::GetInstance()->delegate()->RestoreTab(); - return true; -} - -bool HandleShowTaskManager() { - Shell::GetInstance()->delegate()->ShowTaskManager(); - return true; -} - bool HandleRotatePaneFocus(Shell::Direction direction) { if (!Shell::GetInstance()->delegate()->RotatePaneFocus(direction)) { // No browser window is available. Focus the launcher. @@ -441,7 +410,7 @@ bool AcceleratorController::PerformAction(int action, ash::Shell* shell = ash::Shell::GetInstance(); bool at_login_screen = false; #if defined(OS_CHROMEOS) - at_login_screen = shell->delegate() && !shell->delegate()->IsSessionStarted(); + at_login_screen = !shell->delegate()->IsSessionStarted(); #endif if (at_login_screen && actions_allowed_at_login_screen_.find(action) == @@ -527,17 +496,22 @@ bool AcceleratorController::PerformAction(int action, ash::Shell::GetInstance()->delegate()->OpenFeedbackPage(); return true; case EXIT: - return HandleExit(); + Shell::GetInstance()->delegate()->Exit(); + return true; case NEW_INCOGNITO_WINDOW: - return HandleNewWindow(true /* is_incognito */); + Shell::GetInstance()->delegate()->NewWindow(true /* is_incognito */); + return true; case NEW_TAB: if (key_code == ui::VKEY_T && shell->delegate()) shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEWTAB_T); - return HandleNewTab(); + Shell::GetInstance()->delegate()->NewTab(); + return true; case NEW_WINDOW: - return HandleNewWindow(false /* is_incognito */); + Shell::GetInstance()->delegate()->NewWindow(false /* is_incognito */); + return true; case RESTORE_TAB: - return HandleRestoreTab(); + Shell::GetInstance()->delegate()->RestoreTab(); + return true; case TAKE_SCREENSHOT: if (screenshot_delegate_.get() && screenshot_delegate_->CanTakeScreenshot()) { @@ -636,7 +610,8 @@ bool AcceleratorController::PerformAction(int action, } break; case SHOW_TASK_MANAGER: - return HandleShowTaskManager(); + Shell::GetInstance()->delegate()->ShowTaskManager(); + return true; case NEXT_IME: // This check is necessary e.g. not to process the Shift+Alt+ // ET_KEY_RELEASED accelerator for Chrome OS (see ash/accelerators/ |