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

Unified Diff: chrome/browser/chromeos/preferences.cc

Issue 10836046: Allow offset for secondary display position in chrome://settings/display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
Index: chrome/browser/chromeos/preferences.cc
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index a08db85ba5e4fd044fc3b7d09aadb7ad50e798b5..ac91d72046524c44120e21e420b839768f724c4c 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -250,6 +250,10 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterIntegerPref(prefs::kSecondaryDisplayLayout,
static_cast<int>(DisplayController::RIGHT),
PrefService::UNSYNCABLE_PREF);
+ // The offset of the secondary display position from the primary display.
+ prefs->RegisterIntegerPref(prefs::kSecondaryDisplayOffset,
+ 0,
+ PrefService::UNSYNCABLE_PREF);
// Mobile plan notifications default to on.
prefs->RegisterBooleanPref(prefs::kShowPlanNotifications,
@@ -359,6 +363,7 @@ void Preferences::InitUserPrefs(PrefService* prefs) {
enable_screen_lock_.Init(prefs::kEnableScreenLock, prefs, this);
secondary_display_layout_.Init(prefs::kSecondaryDisplayLayout, prefs, this);
+ secondary_display_offset_.Init(prefs::kSecondaryDisplayOffset, prefs, this);
enable_drm_.Init(prefs::kEnableCrosDRM, prefs, this);
}
@@ -587,6 +592,11 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) {
}
}
+ if (!pref_name || *pref_name == prefs::kSecondaryDisplayOffset) {
+ ash::Shell::GetInstance()->display_controller()->
+ SetSecondaryDisplayOffset(secondary_display_offset_.GetValue());
+ }
+
// Init or update protected content (DRM) support.
if (!pref_name || *pref_name == prefs::kEnableCrosDRM) {
system::ToggleDrm(enable_drm_.GetValue());

Powered by Google App Engine
This is Rietveld 408576698