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

Side by Side 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: rebase and dzhioev's comments Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_PREFERENCES_H_
6 #define CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ 6 #define CHROME_BROWSER_CHROMEOS_PREFERENCES_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/shell_observer.h" 11 #include "ash/shell_observer.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/weak_ptr.h"
13 #include "base/prefs/pref_member.h" 14 #include "base/prefs/pref_member.h"
14 #include "chrome/browser/chromeos/language_preferences.h" 15 #include "chrome/browser/chromeos/language_preferences.h"
15 #include "chrome/browser/chromeos/login/users/user_manager.h" 16 #include "chrome/browser/chromeos/login/users/user_manager.h"
16 #include "chrome/browser/prefs/pref_service_syncable_observer.h" 17 #include "chrome/browser/prefs/pref_service_syncable_observer.h"
17 18
18 class PrefRegistrySimple; 19 class PrefRegistrySimple;
19 class PrefService; 20 class PrefService;
20 class PrefServiceSyncable; 21 class PrefServiceSyncable;
21 22
22 class TracingManager; 23 class TracingManager;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // |REASON_PREF_CHANGED|, otherwise it is empty. 79 // |REASON_PREF_CHANGED|, otherwise it is empty.
79 void ApplyPreferences(ApplyReason reason, 80 void ApplyPreferences(ApplyReason reason,
80 const std::string& pref_name); 81 const std::string& pref_name);
81 82
82 // A variant of SetLanguageConfigStringList. You can pass comma-separated 83 // A variant of SetLanguageConfigStringList. You can pass comma-separated
83 // values. Examples of |value|: "", "Control+space,Hiragana" 84 // values. Examples of |value|: "", "Control+space,Hiragana"
84 void SetLanguageConfigStringListAsCSV(const char* section, 85 void SetLanguageConfigStringListAsCSV(const char* section,
85 const char* name, 86 const char* name,
86 const std::string& value); 87 const std::string& value);
87 88
89 void SetPreferredLanguages(scoped_ptr<std::string> languages);
90
88 // Restores the user's preferred input method / keyboard layout on signing in. 91 // Restores the user's preferred input method / keyboard layout on signing in.
89 void SetInputMethodList(); 92 void SetInputMethodList();
90 93
94 // Sets the enabled extension IMEs from kLanguageEnabledExtensionImes.
95 void SetEnabledExtensionImes();
96
97 // Copies language and input method prefs to their syncable counterparts.
98 void SetSyncableInputMethodPrefs();
99
100 // Add the input methods from the syncable prefs to the device-local prefs.
101 // This should only be called once (after user's first sync) and only adds
102 // to, not removes from, the user's local input method prefs.
103 void MergeSyncedInputMethods();
104
91 // Updates the initial key repeat delay and key repeat interval following 105 // Updates the initial key repeat delay and key repeat interval following
92 // current prefs values. We set the delay and interval at once since an 106 // current prefs values. We set the delay and interval at once since an
93 // underlying XKB API requires it. 107 // underlying XKB API requires it.
94 void UpdateAutoRepeatRate(); 108 void UpdateAutoRepeatRate();
95 109
96 // Force natural scroll to on if --enable-natural-scroll-default is specified 110 // Force natural scroll to on if --enable-natural-scroll-default is specified
97 // on the cmd line. 111 // on the cmd line.
98 void ForceNaturalScrollDefault(); 112 void ForceNaturalScrollDefault();
99 113
100 // PrefServiceSyncableObserver implementation. 114 // PrefServiceSyncableObserver implementation.
(...skipping 18 matching lines...) Expand all
119 BooleanPrefMember natural_scroll_; 133 BooleanPrefMember natural_scroll_;
120 BooleanPrefMember vert_edge_scroll_enabled_; 134 BooleanPrefMember vert_edge_scroll_enabled_;
121 IntegerPrefMember speed_factor_; 135 IntegerPrefMember speed_factor_;
122 IntegerPrefMember mouse_sensitivity_; 136 IntegerPrefMember mouse_sensitivity_;
123 IntegerPrefMember touchpad_sensitivity_; 137 IntegerPrefMember touchpad_sensitivity_;
124 BooleanPrefMember primary_mouse_button_right_; 138 BooleanPrefMember primary_mouse_button_right_;
125 FilePathPrefMember download_default_directory_; 139 FilePathPrefMember download_default_directory_;
126 BooleanPrefMember touch_hud_projection_enabled_; 140 BooleanPrefMember touch_hud_projection_enabled_;
127 141
128 // Input method preferences. 142 // Input method preferences.
143 // These can't sync, because different devices can have different hardware
144 // keyboards or different extensions.
145 StringPrefMember preferred_languages_;
129 StringPrefMember preload_engines_; 146 StringPrefMember preload_engines_;
147 StringPrefMember enabled_extension_imes_;
148 // Instead of syncing the above prefs, there are syncable variants which don't
149 // change the device settings. We can set these to keep track of the user's
150 // most recent choices. That way, after the initial post-OOBE sync, we can at
151 // least add the user's synced choices to the values that have already been
152 // chosen at OOBE. Besides that, the synced values are never used.
153 StringPrefMember preferred_languages_syncable_;
154 StringPrefMember preload_engines_syncable_;
155 StringPrefMember enabled_extension_imes_syncable_;
130 StringPrefMember current_input_method_; 156 StringPrefMember current_input_method_;
131 StringPrefMember previous_input_method_; 157 StringPrefMember previous_input_method_;
132 StringPrefMember enabled_extension_imes_;
133 158
134 BooleanPrefMember xkb_auto_repeat_enabled_; 159 BooleanPrefMember xkb_auto_repeat_enabled_;
135 IntegerPrefMember xkb_auto_repeat_delay_pref_; 160 IntegerPrefMember xkb_auto_repeat_delay_pref_;
136 IntegerPrefMember xkb_auto_repeat_interval_pref_; 161 IntegerPrefMember xkb_auto_repeat_interval_pref_;
137 162
138 // User owning these preferences. 163 // User owning these preferences.
139 const user_manager::User* user_; 164 const user_manager::User* user_;
140 165
141 // Whether user is a primary user. 166 // Whether user is a primary user.
142 bool user_is_primary_; 167 bool user_is_primary_;
143 168
169 base::WeakPtrFactory<Preferences> weak_factory_;
170
144 DISALLOW_COPY_AND_ASSIGN(Preferences); 171 DISALLOW_COPY_AND_ASSIGN(Preferences);
145 }; 172 };
146 173
147 } // namespace chromeos 174 } // namespace chromeos
148 175
149 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ 176 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698