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

Unified Diff: ui/display/manager/display_manager.cc

Issue 2476663003: PlatformScreenOzone using DisplayManager (Closed)
Patch Set: Cleanup. Created 4 years 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: ui/display/manager/display_manager.cc
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc
index 6d3e03ab020d8d978db535f84b075c6ddaddefaa..1e99886b6c160b31ec3fbefae722b6f092ba3d4c 100644
--- a/ui/display/manager/display_manager.cc
+++ b/ui/display/manager/display_manager.cc
@@ -132,7 +132,8 @@ using std::vector;
int64_t DisplayManager::kUnifiedDisplayId = -10;
DisplayManager::DisplayManager(std::unique_ptr<Screen> screen)
- : screen_(std::move(screen)),
+ : configure_displays_(base::SysInfo::IsRunningOnChromeOS()),
+ screen_(std::move(screen)),
layout_store_(new DisplayLayoutStore),
weak_ptr_factory_(this) {
#if defined(OS_CHROMEOS)
@@ -380,7 +381,7 @@ bool DisplayManager::SetDisplayMode(
if (resolution_changed && IsInUnifiedMode()) {
ReconfigureDisplays();
#if defined(OS_CHROMEOS)
- } else if (resolution_changed && base::SysInfo::IsRunningOnChromeOS()) {
+ } else if (resolution_changed && configure_displays_) {
delegate_->display_configurator()->OnConfigurationChanged();
#endif
}
@@ -494,7 +495,7 @@ void DisplayManager::SetColorCalibrationProfile(
if (delegate_)
delegate_->PreDisplayConfigurationChange(false);
// Just sets color profile if it's not running on ChromeOS (like tests).
- if (!base::SysInfo::IsRunningOnChromeOS() ||
+ if (!configure_displays_ ||
delegate_->display_configurator()->SetColorCalibrationProfile(display_id,
profile)) {
display_info_[display_id].SetColorProfile(profile);
@@ -604,8 +605,7 @@ void DisplayManager::OnNativeDisplaysChanged(
}
#if defined(OS_CHROMEOS)
- if (!base::SysInfo::IsRunningOnChromeOS() &&
- new_display_info_list.size() > 1) {
+ if (!configure_displays_ && new_display_info_list.size() > 1) {
DisplayIdList list = GenerateDisplayIdList(
new_display_info_list.begin(), new_display_info_list.end(),
[](const ManagedDisplayInfo& info) { return info.id(); });
@@ -927,7 +927,7 @@ void DisplayManager::SetMirrorMode(bool mirror) {
return;
#if defined(OS_CHROMEOS)
- if (base::SysInfo::IsRunningOnChromeOS()) {
+ if (configure_displays_) {
ui::MultipleDisplayState new_state =
mirror ? ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR
: ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED;
« ui/display/manager/display_manager.h ('K') | « ui/display/manager/display_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698