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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync 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_controller_unittest.cc » ('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 8ace02d653c4ccf76bc66111782b07241a46da6a..c4484def56045a79c9c7ea9f6914d3f39b823c6f 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -22,6 +22,7 @@
#include "ash/magnifier/magnification_controller.h"
#include "ash/root_window_controller.h"
#include "ash/rotator/screen_rotation.h"
+#include "ash/screen_ash.h"
#include "ash/screenshot_delegate.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
@@ -48,6 +49,7 @@
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/layer_animator.h"
+#include "ui/gfx/screen.h"
#include "ui/oak/oak.h"
#include "ui/views/debug_utils.h"
#include "ui/views/widget/widget.h"
@@ -120,6 +122,13 @@ void HandleCycleDisplayMode() {
}
}
+void HandleSwapPrimaryDisplay() {
+ if (gfx::Screen::GetNumDisplays() > 1) {
+ Shell::GetInstance()->display_controller()->SetPrimaryDisplay(
+ ScreenAsh::GetSecondaryDisplay());
+ }
+}
+
#endif // defined(OS_CHROMEOS)
bool HandleExit() {
@@ -441,6 +450,9 @@ bool AcceleratorController::PerformAction(int action,
HandleCycleWindowLinear(CYCLE_FORWARD);
return true;
#if defined(OS_CHROMEOS)
+ case CYCLE_DISPLAY_MODE:
+ HandleCycleDisplayMode();
+ return true;
case LOCK_SCREEN:
return HandleLock();
case OPEN_FILE_MANAGER_DIALOG:
@@ -449,15 +461,15 @@ bool AcceleratorController::PerformAction(int action,
return HandleFileManager(false /* as_dialog */);
case OPEN_CROSH:
return HandleCrosh();
+ case SWAP_PRIMARY_DISPLAY:
+ HandleSwapPrimaryDisplay();
+ return true;
case TOGGLE_SPOKEN_FEEDBACK:
return HandleToggleSpokenFeedback();
case TOGGLE_WIFI:
if (Shell::GetInstance()->tray_delegate())
Shell::GetInstance()->tray_delegate()->ToggleWifi();
return true;
- case CYCLE_DISPLAY_MODE:
- HandleCycleDisplayMode();
- return true;
#endif
case OPEN_FEEDBACK_PAGE:
ash::Shell::GetInstance()->delegate()->OpenFeedbackPage();
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698