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

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

Issue 15381003: Use helper DeviceChangeHandler to call mousecontrol/tpcontrol whenever a device is attached. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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/pref_member.h" 12 #include "base/prefs/pref_member.h"
13 #include "chrome/browser/chromeos/language_preferences.h" 13 #include "chrome/browser/chromeos/language_preferences.h"
14 #include "chrome/browser/chromeos/system/pointer_device_observer.h"
14 #include "chrome/browser/prefs/pref_service_syncable_observer.h" 15 #include "chrome/browser/prefs/pref_service_syncable_observer.h"
15 16
16 class PrefRegistrySimple; 17 class PrefRegistrySimple;
17 class PrefService; 18 class PrefService;
18 class PrefServiceSyncable; 19 class PrefServiceSyncable;
19 20
20 namespace user_prefs { 21 namespace user_prefs {
21 class PrefRegistrySyncable; 22 class PrefRegistrySyncable;
22 } 23 }
23 24
24 namespace chromeos { 25 namespace chromeos {
25 26
26 namespace input_method { 27 namespace input_method {
27 class InputMethodManager; 28 class InputMethodManager;
28 } 29 }
29 30
30 // The Preferences class handles Chrome OS preferences. When the class 31 // The Preferences class handles Chrome OS preferences. When the class
31 // is first initialized, it will initialize the OS settings to what's stored in 32 // is first initialized, it will initialize the OS settings to what's stored in
32 // the preferences. These include touchpad settings, etc. 33 // the preferences. These include touchpad settings, etc.
33 // When the preferences change, we change the settings to reflect the new value. 34 // When the preferences change, we change the settings to reflect the new value.
34 class Preferences : public PrefServiceSyncableObserver { 35 class Preferences : public PrefServiceSyncableObserver,
36 public system::PointerDeviceObserver::Observer {
35 public: 37 public:
36 Preferences(); 38 Preferences();
37 explicit Preferences( 39 explicit Preferences(
38 input_method::InputMethodManager* input_method_manager); // for testing 40 input_method::InputMethodManager* input_method_manager); // for testing
39 virtual ~Preferences(); 41 virtual ~Preferences();
40 42
41 // These method will register the prefs associated with Chrome OS settings. 43 // These method will register the prefs associated with Chrome OS settings.
42 static void RegisterPrefs(PrefRegistrySimple* registry); 44 static void RegisterPrefs(PrefRegistrySimple* registry);
43 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); 45 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry);
44 46
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 98
97 // Updates the initial key repeat delay and key repeat interval following 99 // Updates the initial key repeat delay and key repeat interval following
98 // current prefs values. We set the delay and interval at once since an 100 // current prefs values. We set the delay and interval at once since an
99 // underlying XKB API requires it. 101 // underlying XKB API requires it.
100 void UpdateAutoRepeatRate(); 102 void UpdateAutoRepeatRate();
101 103
102 // Force natural scroll to on if --enable-natural-scroll-default is specified 104 // Force natural scroll to on if --enable-natural-scroll-default is specified
103 // on the cmd line. 105 // on the cmd line.
104 void ForceNaturalScrollDefault(); 106 void ForceNaturalScrollDefault();
105 107
108 // Helpers for preference changes for mouse and touchpad settings.
109 void SetTouchpadPrefs(const std::string* pref_name);
110 void SetMousePrefs(const std::string* pref_name);
111
106 // PrefServiceSyncableObserver implementation. 112 // PrefServiceSyncableObserver implementation.
107 virtual void OnIsSyncingChanged() OVERRIDE; 113 virtual void OnIsSyncingChanged() OVERRIDE;
108 114
115 // PointerDeviceObserver::Observer implementation.
116 virtual void TouchpadExists(bool exists) OVERRIDE;
117 virtual void MouseExists(bool exists) OVERRIDE;
118
109 PrefServiceSyncable* prefs_; 119 PrefServiceSyncable* prefs_;
110 120
111 input_method::InputMethodManager* input_method_manager_; 121 input_method::InputMethodManager* input_method_manager_;
122 scoped_ptr<system::PointerDeviceObserver> pointer_device_observer_;
112 123
113 BooleanPrefMember tap_to_click_enabled_; 124 BooleanPrefMember tap_to_click_enabled_;
114 BooleanPrefMember tap_dragging_enabled_; 125 BooleanPrefMember tap_dragging_enabled_;
115 BooleanPrefMember three_finger_click_enabled_; 126 BooleanPrefMember three_finger_click_enabled_;
116 BooleanPrefMember three_finger_swipe_enabled_; 127 BooleanPrefMember three_finger_swipe_enabled_;
117 BooleanPrefMember natural_scroll_; 128 BooleanPrefMember natural_scroll_;
118 BooleanPrefMember vert_edge_scroll_enabled_; 129 BooleanPrefMember vert_edge_scroll_enabled_;
119 BooleanPrefMember screen_magnifier_enabled_; 130 BooleanPrefMember screen_magnifier_enabled_;
120 IntegerPrefMember screen_magnifier_type_; 131 IntegerPrefMember screen_magnifier_type_;
121 DoublePrefMember screen_magnifier_scale_; 132 DoublePrefMember screen_magnifier_scale_;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 BooleanPrefMember power_allow_screen_wake_locks_; 196 BooleanPrefMember power_allow_screen_wake_locks_;
186 DoublePrefMember power_presentation_idle_delay_factor_; 197 DoublePrefMember power_presentation_idle_delay_factor_;
187 DoublePrefMember power_user_activity_screen_dim_delay_factor_; 198 DoublePrefMember power_user_activity_screen_dim_delay_factor_;
188 199
189 DISALLOW_COPY_AND_ASSIGN(Preferences); 200 DISALLOW_COPY_AND_ASSIGN(Preferences);
190 }; 201 };
191 202
192 } // namespace chromeos 203 } // namespace chromeos
193 204
194 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ 205 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/preferences.cc » ('j') | chrome/browser/chromeos/preferences.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698