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

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

Issue 10829034: Store secondary display layout to the user's preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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());
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698