Chromium Code Reviews| Index: chrome/browser/chromeos/preferences.cc |
| diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc |
| index 48d57b46114fe5d4767cbf97e8da9c6336d29a5d..2efffb0faa0629565d861e33bd2d1dab9b34a79d 100644 |
| --- a/chrome/browser/chromeos/preferences.cc |
| +++ b/chrome/browser/chromeos/preferences.cc |
| @@ -4,6 +4,8 @@ |
| #include "chrome/browser/chromeos/preferences.h" |
| +#include "ash/display/display_controller.h" |
| +#include "ash/shell.h" |
| #include "base/chromeos/chromeos_version.h" |
| #include "base/command_line.h" |
| #include "base/i18n/time_formatting.h" |
| @@ -47,6 +49,8 @@ bool IsLumpy() { |
| } // namespace |
| +using ash::internal::DisplayController; |
| + |
| static const char kFallbackInputMethodLocale[] = "en-US"; |
| Preferences::Preferences() |
| @@ -242,6 +246,11 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) { |
| false, |
| PrefService::SYNCABLE_PREF); |
| + // Secondary display layout. |
| + prefs->RegisterIntegerPref(prefs::kSecondaryDisplayLayout, |
| + static_cast<int>(DisplayController::RIGHT), |
| + PrefService::UNSYNCABLE_PREF); |
| + |
| // Mobile plan notifications default to on. |
| prefs->RegisterBooleanPref(prefs::kShowPlanNotifications, |
| true, |
| @@ -349,6 +358,8 @@ void Preferences::InitUserPrefs(PrefService* prefs) { |
| enable_screen_lock_.Init(prefs::kEnableScreenLock, prefs, this); |
| + secondary_display_layout_.Init(prefs::kSecondaryDisplayLayout, prefs, this); |
| + |
| enable_drm_.Init(prefs::kEnableCrosDRM, prefs, this); |
| } |
| @@ -566,6 +577,14 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) { |
| enable_screen_lock_.GetValue()); |
| } |
| + if (!pref_name || *pref_name == prefs::kSecondaryDisplayLayout) { |
| + int layout = secondary_display_layout_.GetValue(); |
| + DCHECK_LE(static_cast<int>(DisplayController::TOP), layout); |
| + DCHECK_GE(static_cast<int>(DisplayController::LEFT), layout); |
|
oshima
2012/07/26 15:05:19
it's probably better to ignore the value if it's o
Jun Mukai
2012/07/26 16:29:49
Done.
|
| + ash::Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout( |
| + static_cast<DisplayController::SecondaryDisplayLayout>(layout)); |
| + } |
| + |
| // Init or update protected content (DRM) support. |
| if (!pref_name || *pref_name == prefs::kEnableCrosDRM) { |
| system::ToggleDrm(enable_drm_.GetValue()); |