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

Unified Diff: ash/display/display_layout.cc

Issue 1261693004: Allow dynamic enabling/disabling of unified desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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.h ('k') | ash/display/display_layout_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_layout.cc
diff --git a/ash/display/display_layout.cc b/ash/display/display_layout.cc
index 2cf54a6f2d51e41400d26e1c0e740d829128b963..9816f21b694d54909c03da804e908d282f6150f7 100644
--- a/ash/display/display_layout.cc
+++ b/ash/display/display_layout.cc
@@ -5,7 +5,9 @@
#include "ash/display/display_layout.h"
#include "ash/ash_switches.h"
+#include "ash/display/display_manager.h"
#include "ash/display/display_pref_util.h"
+#include "ash/shell.h"
#include "base/json/json_value_converter.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
@@ -72,7 +74,7 @@ DisplayLayout::DisplayLayout()
offset(0),
mirrored(false),
#if defined(OS_CHROMEOS)
- default_unified(switches::UnifiedDesktopEnabled()),
+ default_unified(true),
#else
default_unified(false),
#endif
@@ -84,7 +86,7 @@ DisplayLayout::DisplayLayout(DisplayLayout::Position position, int offset)
offset(offset),
mirrored(false),
#if defined(OS_CHROMEOS)
- default_unified(switches::UnifiedDesktopEnabled()),
+ default_unified(true),
#else
default_unified(false),
#endif
@@ -146,9 +148,13 @@ bool DisplayLayout::ConvertToValue(const DisplayLayout& layout,
std::string DisplayLayout::ToString() const {
const std::string position_str = GetStringFromPosition(position);
+ bool unified =
+ default_unified &&
+ Shell::GetInstance()->display_manager()->unified_desktop_enabled();
+
return base::StringPrintf("%s, %d%s%s", position_str.c_str(), offset,
mirrored ? ", mirrored" : "",
- default_unified ? ", unified" : "");
+ unified ? ", unified" : "");
}
// static
« no previous file with comments | « ash/display/display_layout.h ('k') | ash/display/display_layout_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698