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

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

Issue 312023002: Sync starting language and input method preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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.h
diff --git a/chrome/browser/chromeos/preferences.h b/chrome/browser/chromeos/preferences.h
index 3ba680fdda6ae4bc5ebe2c9b5b33e71af839b3ab..03e6170d1ffc008be49dbec3b018a48c93a9270b 100644
--- a/chrome/browser/chromeos/preferences.h
+++ b/chrome/browser/chromeos/preferences.h
@@ -10,6 +10,7 @@
#include "ash/shell_observer.h"
#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
#include "base/prefs/pref_member.h"
#include "chrome/browser/chromeos/language_preferences.h"
#include "chrome/browser/chromeos/login/users/user_manager.h"
@@ -84,9 +85,22 @@ class Preferences : public PrefServiceSyncableObserver,
const char* name,
const std::string& value);
+ void SetPreferredLanguages(scoped_ptr<std::string> languages);
+
// Restores the user's preferred input method / keyboard layout on signing in.
void SetInputMethodList();
+ // Sets the enabled extension IMEs from kLanguageEnabledExtensionImes.
+ void SetEnabledExtensionImes();
+
+ // Copies language and input method prefs to their syncable counterparts.
+ void SetSyncableInputMethodPrefs();
+
+ // Add the input methods from the syncable prefs to the device-local prefs.
+ // This should only be called once (after user's first sync) and only adds
+ // to, not removes from, the user's local input method prefs.
+ void MergeSyncedInputMethods();
+
// Updates the initial key repeat delay and key repeat interval following
// current prefs values. We set the delay and interval at once since an
// underlying XKB API requires it.
@@ -124,10 +138,21 @@ class Preferences : public PrefServiceSyncableObserver,
BooleanPrefMember touch_hud_projection_enabled_;
// Input method preferences.
+ // These can't sync, because different devices can have different hardware
+ // keyboards or different extensions.
+ StringPrefMember preferred_languages_;
StringPrefMember preload_engines_;
+ StringPrefMember enabled_extension_imes_;
+ // Instead of syncing the above prefs, there are syncable variants which don't
+ // change the device settings. We can set these to keep track of the user's
+ // most recent choices. That way, after the initial post-OOBE sync, we can at
+ // least add the user's synced choices to the values that have already been
+ // chosen at OOBE. Besides that, the synced values are never used.
+ StringPrefMember preferred_languages_syncable_;
+ StringPrefMember preload_engines_syncable_;
+ StringPrefMember enabled_extension_imes_syncable_;
StringPrefMember current_input_method_;
StringPrefMember previous_input_method_;
- StringPrefMember enabled_extension_imes_;
BooleanPrefMember xkb_auto_repeat_enabled_;
IntegerPrefMember xkb_auto_repeat_delay_pref_;
@@ -139,6 +164,8 @@ class Preferences : public PrefServiceSyncableObserver,
// Whether user is a primary user.
bool user_is_primary_;
+ base::WeakPtrFactory<Preferences> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Preferences);
};

Powered by Google App Engine
This is Rietveld 408576698