| Index: chrome/browser/chromeos/preferences.cc
|
| diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
|
| index 48d57b46114fe5d4767cbf97e8da9c6336d29a5d..a08db85ba5e4fd044fc3b7d09aadb7ad50e798b5 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,16 @@ 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();
|
| + if (static_cast<int>(DisplayController::TOP) <= layout &&
|
| + layout <= static_cast<int>(DisplayController::LEFT)) {
|
| + 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());
|
|
|