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

Unified Diff: ash/display/display_manager.cc

Issue 1150913002: Save and restore unified mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix leak 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_layout_store.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 92c0f59f5966f78a81f058e788c52ed392615ba0..24e2bc18f47ac89fc7f6a44a55383aef78ef391d 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -140,9 +140,6 @@ DisplayManager::DisplayManager()
if (base::SysInfo::IsRunningOnChromeOS())
DisplayInfo::SetUse125DSFForUIScaling(true);
- if (switches::UnifiedDesktopEnabled())
- default_multi_display_mode_ = UNIFIED;
-
change_display_upon_host_resize_ = !base::SysInfo::IsRunningOnChromeOS();
#endif
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_.get());
@@ -641,6 +638,8 @@ void DisplayManager::OnNativeDisplaysChanged(
if (gfx::Display::HasInternalDisplay() && !internal_display_connected &&
display_info_.find(gfx::Display::InternalDisplayId()) ==
display_info_.end()) {
+ // Create a dummy internal display if the chrome restarted
+ // in docked mode.
DisplayInfo internal_display_info(
gfx::Display::InternalDisplayId(),
l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME),
@@ -648,6 +647,25 @@ void DisplayManager::OnNativeDisplaysChanged(
internal_display_info.SetBounds(gfx::Rect(0, 0, 800, 600));
display_info_[gfx::Display::InternalDisplayId()] = internal_display_info;
}
+
+#if defined(OS_CHROMEOS)
+ if (new_display_info_list.size() > 1) {
+ std::sort(new_display_info_list.begin(), new_display_info_list.end(),
+ DisplayInfoSortFunctor());
+ DisplayIdPair pair = std::make_pair(new_display_info_list[0].id(),
+ new_display_info_list[1].id());
+ DisplayLayout layout = layout_store_->GetRegisteredDisplayLayout(pair);
+ default_multi_display_mode_ =
+ (layout.default_unified && switches::UnifiedDesktopEnabled())
+ ? UNIFIED
+ : EXTENDED;
+ // Mirror mode is set by DisplayConfigurator on the device.
+ // Emulate it when running on linux desktop.
+ if (!base::SysInfo::IsRunningOnChromeOS() && layout.mirrored)
+ SetMultiDisplayMode(MIRRORING);
+ }
+#endif
+
UpdateDisplays(new_display_info_list);
}
« no previous file with comments | « ash/display/display_layout_store.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698