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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10909043: Cancel drag if display configuration changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/accelerators/accelerator_table.h » ('j') | no next file with comments »
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 511087dbff601623c2eaf760f77ae670fb7106d6..533f1e6b6d5836dd8e22be2f439f5c53bf1720e6 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();
@@ -674,12 +679,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;
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698