Index: ash/accelerators/accelerator_controller.cc |
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc |
index 1311b19cd461780bcf8f2dff504056b60dde2036..aa6143bfd9262f9971f73d047a0e9474e090a063 100644 |
--- a/ash/accelerators/accelerator_controller.cc |
+++ b/ash/accelerators/accelerator_controller.cc |
@@ -53,6 +53,7 @@ |
#if defined(OS_CHROMEOS) |
#include "ash/display/output_configurator_animation.h" |
+#include "base/chromeos/chromeos_version.h" |
#include "chromeos/display/output_configurator.h" |
#endif // defined(OS_CHROMEOS) |
@@ -105,7 +106,20 @@ bool HandleToggleSpokenFeedback() { |
Shell::GetInstance()->delegate()->ToggleSpokenFeedback(); |
return true; |
} |
-#endif |
+void HandleCycleDisplayMode() { |
+ Shell* shell = Shell::GetInstance(); |
+ if (!base::chromeos::IsRunningOnChromeOS()) { |
+ internal::MultiDisplayManager::CycleDisplay(); |
+ } else if (shell->output_configurator()->connected_output_count() > 1) { |
+ internal::OutputConfiguratorAnimation* animation = |
+ shell->output_configurator_animation(); |
+ animation->StartFadeOutAnimation(base::Bind( |
+ base::IgnoreResult(&chromeos::OutputConfigurator::CycleDisplayMode), |
+ base::Unretained(shell->output_configurator()))); |
+ } |
+} |
+ |
+#endif // defined(OS_CHROMEOS) |
bool HandleExit() { |
ShellDelegate* delegate = Shell::GetInstance()->delegate(); |
@@ -440,18 +454,9 @@ bool AcceleratorController::PerformAction(int action, |
if (Shell::GetInstance()->tray_delegate()) |
Shell::GetInstance()->tray_delegate()->ToggleWifi(); |
return true; |
- case CYCLE_DISPLAY_MODE: { |
- Shell* shell = Shell::GetInstance(); |
- if (shell->output_configurator()->connected_output_count() > 1) { |
- internal::OutputConfiguratorAnimation* animation = |
- shell->output_configurator_animation(); |
- animation->StartFadeOutAnimation(base::Bind( |
- base::IgnoreResult(&chromeos::OutputConfigurator::CycleDisplayMode), |
- base::Unretained(shell->output_configurator()))); |
- return true; |
- } |
- return false; |
- } |
+ case CYCLE_DISPLAY_MODE: |
+ HandleCycleDisplayMode(); |
+ return true; |
#endif |
case OPEN_FEEDBACK_PAGE: |
ash::Shell::GetInstance()->delegate()->OpenFeedbackPage(); |
@@ -667,12 +672,6 @@ bool AcceleratorController::PerformAction(int action, |
return HandleToggleDesktopBackgroundMode(); |
case TOGGLE_ROOT_WINDOW_FULL_SCREEN: |
return HandleToggleRootWindowFullScreen(); |
- case DISPLAY_ADD_REMOVE: |
- internal::MultiDisplayManager::AddRemoveDisplay(); |
- return true; |
- case DISPLAY_CYCLE: |
- internal::MultiDisplayManager::CycleDisplay(); |
- return true; |
case DISPLAY_TOGGLE_SCALE: |
internal::MultiDisplayManager::ToggleDisplayScale(); |
return true; |