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

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 897e5f4445c8265692b6a2dfd1673d2101a3b06b..8f5fdac9a3aef5ab5e6c9001eef36d2e681110e2 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -252,6 +252,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,
@@ -361,6 +365,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);
}
@@ -589,6 +594,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