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

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: Rebase 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
« no previous file with comments | « ash/BUILD.gn ('k') | ash/ash.gyp » ('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 91d21a6583e5195482be54adcf750cd3c499e425..e599f0cc7e637501547ba9d188654c08552f551a 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,8 @@ void HandleSilenceSpokenFeedback() {
void HandleSwapPrimaryDisplay() {
base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display"));
- Shell::GetInstance()->window_tree_host_manager()->SwapPrimaryDisplay();
+ Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId(
+ ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */);
}
bool CanHandleCycleUser() {
@@ -684,7 +687,9 @@ void HandleToggleCapsLock() {
void HandleToggleMirrorMode() {
base::RecordAction(UserMetricsAction("Accel_Toggle_Mirror_Mode"));
- Shell::GetInstance()->window_tree_host_manager()->ToggleMirrorMode();
+ bool mirror = !Shell::GetInstance()->display_manager()->IsInMirrorMode();
+ Shell::GetInstance()->display_configuration_controller()->SetMirrorMode(
+ mirror, true /* user_action */);
}
void HandleToggleSpokenFeedback() {
« no previous file with comments | « ash/BUILD.gn ('k') | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698