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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 1594683002: Introduce DisplayConfigurationController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_576375_display1b1
Patch Set: DisplayAnimator -> DisplayAnimatorChromeOS Created 4 years, 11 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
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 25fde9c36bfe09aa2b58c0fb5bcdbf70dc8a99f6..ebfe1a80d7fd9a19d3a35f4b1a6ad26c437d66a0 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -25,6 +25,7 @@
#include "ash/root_window_controller.h"
#include "ash/rotator/screen_rotation_animator.h"
#include "ash/rotator/window_rotation.h"
+#include "ash/screen_util.h"
#include "ash/screenshot_delegate.h"
#include "ash/session/session_state_delegate.h"
#include "ash/shelf/shelf.h"
@@ -75,6 +76,7 @@
#include "ui/views/controls/webview/webview.h"
#if defined(OS_CHROMEOS)
+#include "ash/display/display_configuration_controller.h"
#include "ash/system/chromeos/keyboard_brightness_controller.h"
#include "base/sys_info.h"
#include "ui/base/ime/chromeos/ime_keyboard.h"
@@ -635,7 +637,11 @@ void HandleSilenceSpokenFeedback() {
void HandleSwapPrimaryDisplay() {
base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display"));
- Shell::GetInstance()->window_tree_host_manager()->SwapPrimaryDisplay();
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ if (display_manager->GetNumDisplays() < 2)
+ return;
+ Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId(
+ ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */);
}
bool CanHandleCycleUser() {
@@ -684,7 +690,15 @@ void HandleToggleCapsLock() {
void HandleToggleMirrorMode() {
base::RecordAction(UserMetricsAction("Accel_Toggle_Mirror_Mode"));
+ bool mirror = !Shell::GetInstance()->display_manager()->IsInMirrorMode();
+#if defined(OS_CHROMEOS)
oshima 2016/01/20 02:02:51 we can now remove this ifdef?
stevenjb 2016/01/20 02:13:12 Yeah, I cleaned that up in PS 6.
+ Shell::GetInstance()->display_configuration_controller()->SetMirrorMode(
+ mirror, true /* user_action */);
+#else
+ // On non Chrome OS platforms this toggle mirror mode immediately with
+ // no animation or frequencey limiter.
Shell::GetInstance()->window_tree_host_manager()->ToggleMirrorMode();
+#endif
}
void HandleToggleSpokenFeedback() {
« no previous file with comments | « ash/BUILD.gn ('k') | ash/ash.gyp » ('j') | ash/display/display_animator_chromeos.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698