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

Unified Diff: ash/display/mirror_window_controller.cc

Issue 1126933004: Allow switching between extended and unified (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/display/display_manager_unittest.cc ('k') | ash/host/ash_window_tree_host_unified.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/mirror_window_controller.cc
diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc
index 529353713927e4d2679d91091c911f79fad74d6d..fc88b79dd7ae837bf94c7e9aabcf56e0b261999a 100644
--- a/ash/display/mirror_window_controller.cc
+++ b/ash/display/mirror_window_controller.cc
@@ -120,6 +120,14 @@ class NoneCaptureClient : public aura::client::CaptureClient {
DISALLOW_COPY_AND_ASSIGN(NoneCaptureClient);
};
+DisplayManager::MultiDisplayMode GetCurrentMultiDisplayMode() {
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ return display_manager->IsInUnifiedMode()
+ ? DisplayManager::UNIFIED
+ : (display_manager->IsInMirrorMode() ? DisplayManager::MIRRORING
+ : DisplayManager::EXTENDED);
+}
+
} // namespace
struct MirrorWindowController::MirroringHostInfo {
@@ -153,6 +161,8 @@ void MirrorWindowController::UpdateWindow(
const DisplayInfo& source_display_info =
display_manager->GetDisplayInfo(primary.id());
+ multi_display_mode_ = GetCurrentMultiDisplayMode();
+
gfx::Point mirroring_origin;
for (const DisplayInfo& display_info : display_info_list) {
if (mirroring_host_info_map_.find(display_info.id()) ==
@@ -268,13 +278,7 @@ void MirrorWindowController::UpdateWindow() {
}
void MirrorWindowController::CloseIfNotNecessary() {
- DisplayManager* display_manager = Shell::GetInstance()->display_manager();
-
- DisplayManager::MultiDisplayMode new_mode =
- display_manager->IsInUnifiedMode()
- ? DisplayManager::UNIFIED
- : (display_manager->IsInMirrorMode() ? DisplayManager::MIRRORING
- : DisplayManager::EXTENDED);
+ DisplayManager::MultiDisplayMode new_mode = GetCurrentMultiDisplayMode();
if (multi_display_mode_ != new_mode)
Close(true);
multi_display_mode_ = new_mode;
« no previous file with comments | « ash/display/display_manager_unittest.cc ('k') | ash/host/ash_window_tree_host_unified.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698