OLD | NEW |
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/prefs/pref_member.h" | 13 #include "base/prefs/pref_member.h" |
14 #include "chrome/browser/chromeos/language_preferences.h" | 14 #include "chrome/browser/chromeos/language_preferences.h" |
15 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
16 #include "chrome/browser/prefs/pref_service_syncable_observer.h" | 15 #include "chrome/browser/prefs/pref_service_syncable_observer.h" |
| 16 #include "components/user_manager/user_manager.h" |
17 | 17 |
18 class PrefRegistrySimple; | 18 class PrefRegistrySimple; |
19 class PrefService; | 19 class PrefService; |
20 class PrefServiceSyncable; | 20 class PrefServiceSyncable; |
21 | 21 |
22 class TracingManager; | 22 class TracingManager; |
23 | 23 |
24 namespace user_prefs { | 24 namespace user_prefs { |
25 class PrefRegistrySyncable; | 25 class PrefRegistrySyncable; |
26 } | 26 } |
27 | 27 |
28 namespace chromeos { | 28 namespace chromeos { |
29 | 29 |
30 class User; | 30 class User; |
31 | 31 |
32 namespace input_method { | 32 namespace input_method { |
33 class InputMethodManager; | 33 class InputMethodManager; |
34 } | 34 } |
35 | 35 |
36 // The Preferences class handles Chrome OS preferences. When the class | 36 // The Preferences class handles Chrome OS preferences. When the class |
37 // is first initialized, it will initialize the OS settings to what's stored in | 37 // is first initialized, it will initialize the OS settings to what's stored in |
38 // the preferences. These include touchpad settings, etc. | 38 // the preferences. These include touchpad settings, etc. |
39 // When the preferences change, we change the settings to reflect the new value. | 39 // When the preferences change, we change the settings to reflect the new value. |
40 class Preferences : public PrefServiceSyncableObserver, | 40 class Preferences : public PrefServiceSyncableObserver, |
41 public ash::ShellObserver, | 41 public ash::ShellObserver, |
42 public UserManager::UserSessionStateObserver { | 42 public user_manager::UserManager::UserSessionStateObserver { |
43 public: | 43 public: |
44 Preferences(); | 44 Preferences(); |
45 explicit Preferences( | 45 explicit Preferences( |
46 input_method::InputMethodManager* input_method_manager); // for testing | 46 input_method::InputMethodManager* input_method_manager); // for testing |
47 virtual ~Preferences(); | 47 virtual ~Preferences(); |
48 | 48 |
49 // These method will register the prefs associated with Chrome OS settings. | 49 // These method will register the prefs associated with Chrome OS settings. |
50 static void RegisterPrefs(PrefRegistrySimple* registry); | 50 static void RegisterPrefs(PrefRegistrySimple* registry); |
51 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 51 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
52 | 52 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Force natural scroll to on if --enable-natural-scroll-default is specified | 96 // Force natural scroll to on if --enable-natural-scroll-default is specified |
97 // on the cmd line. | 97 // on the cmd line. |
98 void ForceNaturalScrollDefault(); | 98 void ForceNaturalScrollDefault(); |
99 | 99 |
100 // PrefServiceSyncableObserver implementation. | 100 // PrefServiceSyncableObserver implementation. |
101 virtual void OnIsSyncingChanged() OVERRIDE; | 101 virtual void OnIsSyncingChanged() OVERRIDE; |
102 | 102 |
103 // Overriden from ash::ShellObserver. | 103 // Overriden from ash::ShellObserver. |
104 virtual void OnTouchHudProjectionToggled(bool enabled) OVERRIDE; | 104 virtual void OnTouchHudProjectionToggled(bool enabled) OVERRIDE; |
105 | 105 |
106 // Overriden form UserManager::UserSessionStateObserver. | 106 // Overriden form user_manager::UserManager::UserSessionStateObserver. |
107 virtual void ActiveUserChanged( | 107 virtual void ActiveUserChanged( |
108 const user_manager::User* active_user) OVERRIDE; | 108 const user_manager::User* active_user) OVERRIDE; |
109 | 109 |
110 PrefServiceSyncable* prefs_; | 110 PrefServiceSyncable* prefs_; |
111 | 111 |
112 input_method::InputMethodManager* input_method_manager_; | 112 input_method::InputMethodManager* input_method_manager_; |
113 scoped_ptr<TracingManager> tracing_manager_; | 113 scoped_ptr<TracingManager> tracing_manager_; |
114 | 114 |
115 BooleanPrefMember performance_tracing_enabled_; | 115 BooleanPrefMember performance_tracing_enabled_; |
116 BooleanPrefMember tap_to_click_enabled_; | 116 BooleanPrefMember tap_to_click_enabled_; |
(...skipping 23 matching lines...) Expand all Loading... |
140 | 140 |
141 // Whether user is a primary user. | 141 // Whether user is a primary user. |
142 bool user_is_primary_; | 142 bool user_is_primary_; |
143 | 143 |
144 DISALLOW_COPY_AND_ASSIGN(Preferences); | 144 DISALLOW_COPY_AND_ASSIGN(Preferences); |
145 }; | 145 }; |
146 | 146 |
147 } // namespace chromeos | 147 } // namespace chromeos |
148 | 148 |
149 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ | 149 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ |
OLD | NEW |