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

Side by Side Diff: chrome/browser/chromeos/preferences.h

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to PrefRegistrySyncable and PrefServiceSyncable to let sync know of pre-registered prefs. Created 7 years, 10 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 "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/prefs/public/pref_member.h" 12 #include "base/prefs/public/pref_member.h"
13 #include "chrome/browser/chromeos/language_preferences.h" 13 #include "chrome/browser/chromeos/language_preferences.h"
14 #include "chrome/browser/prefs/pref_service_syncable_observer.h" 14 #include "chrome/browser/prefs/pref_service_syncable_observer.h"
15 15
16 class PrefRegistrySyncable;
16 class PrefService; 17 class PrefService;
17 class PrefServiceSyncable; 18 class PrefServiceSyncable;
18 19
19 namespace chromeos { 20 namespace chromeos {
20 namespace input_method { 21 namespace input_method {
21 class InputMethodManager; 22 class InputMethodManager;
22 } // namespace input_method 23 } // namespace input_method
23 24
24 // The Preferences class handles Chrome OS preferences. When the class 25 // The Preferences class handles Chrome OS preferences. When the class
25 // is first initialized, it will initialize the OS settings to what's stored in 26 // is first initialized, it will initialize the OS settings to what's stored in
26 // the preferences. These include touchpad settings, etc. 27 // the preferences. These include touchpad settings, etc.
27 // When the preferences change, we change the settings to reflect the new value. 28 // When the preferences change, we change the settings to reflect the new value.
28 class Preferences : public PrefServiceSyncableObserver { 29 class Preferences : public PrefServiceSyncableObserver {
29 public: 30 public:
30 Preferences(); 31 Preferences();
31 explicit Preferences( 32 explicit Preferences(
32 input_method::InputMethodManager* input_method_manager); // for testing 33 input_method::InputMethodManager* input_method_manager); // for testing
33 virtual ~Preferences(); 34 virtual ~Preferences();
34 35
35 // This method will register the prefs associated with Chrome OS settings. 36 // This method will register the prefs associated with Chrome OS settings.
36 static void RegisterUserPrefs(PrefServiceSyncable* prefs); 37 static void RegisterUserPrefs(PrefService* prefs,
38 PrefRegistrySyncable* registry);
37 39
38 // This method will initialize Chrome OS settings to values in user prefs. 40 // This method will initialize Chrome OS settings to values in user prefs.
39 void Init(PrefServiceSyncable* prefs); 41 void Init(PrefServiceSyncable* prefs);
40 42
41 void InitUserPrefsForTesting(PrefServiceSyncable* prefs); 43 void InitUserPrefsForTesting(PrefServiceSyncable* prefs);
42 void SetInputMethodListForTesting(); 44 void SetInputMethodListForTesting();
43 45
44 private: 46 private:
45 // Initializes all member prefs. 47 // Initializes all member prefs.
46 void InitUserPrefs(PrefServiceSyncable* prefs); 48 void InitUserPrefs(PrefServiceSyncable* prefs);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 BooleanPrefMember enable_screen_lock_; 160 BooleanPrefMember enable_screen_lock_;
159 161
160 BooleanPrefMember enable_drm_; 162 BooleanPrefMember enable_drm_;
161 163
162 DISALLOW_COPY_AND_ASSIGN(Preferences); 164 DISALLOW_COPY_AND_ASSIGN(Preferences);
163 }; 165 };
164 166
165 } // namespace chromeos 167 } // namespace chromeos
166 168
167 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ 169 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698