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 "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_observer.h" | |
14 | 15 |
15 class PrefService; | 16 class PrefService; |
16 | 17 |
17 namespace chromeos { | 18 namespace chromeos { |
18 namespace input_method { | 19 namespace input_method { |
19 class InputMethodManager; | 20 class InputMethodManager; |
20 } // namespace input_method | 21 } // namespace input_method |
21 | 22 |
22 // The Preferences class handles Chrome OS preferences. When the class | 23 // The Preferences class handles Chrome OS preferences. When the class |
23 // is first initialized, it will initialize the OS settings to what's stored in | 24 // is first initialized, it will initialize the OS settings to what's stored in |
24 // the preferences. These include touchpad settings, etc. | 25 // the preferences. These include touchpad settings, etc. |
25 // When the preferences change, we change the settings to reflect the new value. | 26 // When the preferences change, we change the settings to reflect the new value. |
26 class Preferences { | 27 class Preferences : public PrefServiceObserver { |
27 public: | 28 public: |
28 Preferences(); | 29 Preferences(); |
29 explicit Preferences( | 30 explicit Preferences( |
30 input_method::InputMethodManager* input_method_manager); // for testing | 31 input_method::InputMethodManager* input_method_manager); // for testing |
31 virtual ~Preferences(); | 32 virtual ~Preferences(); |
32 | 33 |
33 // This method will register the prefs associated with Chrome OS settings. | 34 // This method will register the prefs associated with Chrome OS settings. |
34 static void RegisterUserPrefs(PrefService* prefs); | 35 static void RegisterUserPrefs(PrefService* prefs); |
35 | 36 |
36 // This method will initialize Chrome OS settings to values in user prefs. | 37 // This method will initialize Chrome OS settings to values in user prefs. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 const std::string& value); | 84 const std::string& value); |
84 | 85 |
85 // Restores the user's preferred input method / keyboard layout on signing in. | 86 // Restores the user's preferred input method / keyboard layout on signing in. |
86 void SetInputMethodList(); | 87 void SetInputMethodList(); |
87 | 88 |
88 // Updates the initial key repeat delay and key repeat interval following | 89 // Updates the initial key repeat delay and key repeat interval following |
89 // current prefs values. We set the delay and interval at once since an | 90 // current prefs values. We set the delay and interval at once since an |
90 // underlying XKB API requires it. | 91 // underlying XKB API requires it. |
91 void UpdateAutoRepeatRate(); | 92 void UpdateAutoRepeatRate(); |
92 | 93 |
94 // PrefServiceObserver implementation. | |
95 virtual void OnIsSyncingChanged() OVERRIDE; | |
xiyuan
2012/12/20 01:44:28
nit: keep virtual methods after non-virtual ones.
achuithb
2012/12/20 01:53:31
Done.
| |
96 | |
97 // Force natural scroll to on if --enable-natural-scroll-default is specified | |
98 // on the cmd line. | |
99 void ForceNaturalScrollDefault(); | |
100 | |
93 PrefService* prefs_; | 101 PrefService* prefs_; |
94 | 102 |
95 input_method::InputMethodManager* input_method_manager_; | 103 input_method::InputMethodManager* input_method_manager_; |
96 | 104 |
97 BooleanPrefMember tap_to_click_enabled_; | 105 BooleanPrefMember tap_to_click_enabled_; |
98 BooleanPrefMember tap_dragging_enabled_; | 106 BooleanPrefMember tap_dragging_enabled_; |
99 BooleanPrefMember three_finger_click_enabled_; | 107 BooleanPrefMember three_finger_click_enabled_; |
100 BooleanPrefMember three_finger_swipe_enabled_; | 108 BooleanPrefMember three_finger_swipe_enabled_; |
101 BooleanPrefMember natural_scroll_; | 109 BooleanPrefMember natural_scroll_; |
102 BooleanPrefMember vert_edge_scroll_enabled_; | 110 BooleanPrefMember vert_edge_scroll_enabled_; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 BooleanPrefMember enable_screen_lock_; | 156 BooleanPrefMember enable_screen_lock_; |
149 | 157 |
150 BooleanPrefMember enable_drm_; | 158 BooleanPrefMember enable_drm_; |
151 | 159 |
152 DISALLOW_COPY_AND_ASSIGN(Preferences); | 160 DISALLOW_COPY_AND_ASSIGN(Preferences); |
153 }; | 161 }; |
154 | 162 |
155 } // namespace chromeos | 163 } // namespace chromeos |
156 | 164 |
157 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ | 165 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ |
OLD | NEW |