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

Unified Diff: ash/display/display_controller.cc

Issue 1119953002: Enable display rotation, magnifier in unified desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/display/display_manager.h » ('j') | ash/host/ash_window_tree_host_unified.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller.cc
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 4044fe76464973527bd587b74faa68f5f90330be..898268471bc987217358f88454c0da61bb4f246d 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -17,6 +17,8 @@
#include "ash/host/ash_window_tree_host.h"
#include "ash/host/ash_window_tree_host_init_params.h"
#include "ash/host/root_window_transformer.h"
+#include "ash/magnifier/magnification_controller.h"
+#include "ash/magnifier/partial_magnification_controller.h"
#include "ash/root_window_controller.h"
#include "ash/root_window_settings.h"
#include "ash/screen_util.h"
@@ -367,7 +369,7 @@ aura::Window* DisplayController::GetRootWindowForDisplayId(int64 id) {
AshWindowTreeHost* DisplayController::GetAshWindowTreeHostForDisplayId(
int64 id) {
- CHECK_EQ(1u, window_tree_hosts_.count(id));
+ CHECK_EQ(1u, window_tree_hosts_.count(id)) << "id = " << id;
return window_tree_hosts_[id];
}
@@ -640,6 +642,14 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) {
AddWindowTreeHostForDisplay(display, AshWindowTreeHostInitParams());
RootWindowController::CreateForSecondaryDisplay(ash_host);
+ // Magnifier controllers keep pointers to the current root window.
+ // Update them here to avoid accessing them later.
+ Shell::GetInstance()->magnification_controller()->SwitchTargetRootWindow(
+ ash_host->AsWindowTreeHost()->window(), false);
+ Shell::GetInstance()
+ ->partial_magnification_controller()
+ ->SwitchTargetRootWindow(ash_host->AsWindowTreeHost()->window());
+
if (primary_tree_host_for_replace_) {
AshWindowTreeHost* to_delete = primary_tree_host_for_replace_;
primary_tree_host_for_replace_ = nullptr;
« no previous file with comments | « no previous file | ash/display/display_manager.h » ('j') | ash/host/ash_window_tree_host_unified.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698