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

Side by Side Diff: chrome/browser/chromeos/system/input_device_settings.h

Issue 397063004: wip: not complete. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/system/input_device_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SYSTEM_INPUT_DEVICE_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void SetThreeFingerClick(bool enabled); 93 void SetThreeFingerClick(bool enabled);
94 bool GetThreeFingerClick() const; 94 bool GetThreeFingerClick() const;
95 95
96 void SetTapDragging(bool enabled); 96 void SetTapDragging(bool enabled);
97 bool GetTapDragging() const; 97 bool GetTapDragging() const;
98 98
99 void SetNaturalScroll(bool enabled); 99 void SetNaturalScroll(bool enabled);
100 bool GetNaturalScroll() const; 100 bool GetNaturalScroll() const;
101 101
102 #if defined(USE_OZONE)
103 // Updates |this| with |settings|. If at least one settings was updated, configures all associated ozone event converters appropriately for the new sett ing.
104 bool Update(const TouchpadSettings& settings);
105 #else
102 // Updates |this| with |settings|. If at least one setting was updated returns 106 // Updates |this| with |settings|. If at least one setting was updated returns
103 // true. 107 // true.
104 // |argv| is filled with arguments of script, that should be launched in order 108 // |argv| is filled with arguments of script, that should be launched in order
105 // to apply update. This argument is optional and could be NULL. 109 // to apply update. This argument is optional and could be NULL.
106 bool Update(const TouchpadSettings& settings, std::vector<std::string>* argv); 110 bool Update(const TouchpadSettings& settings, std::vector<std::string>* argv);
107 111 #endif
108 private: 112 private:
109 internal::Optional<int> sensitivity_; 113 internal::Optional<int> sensitivity_;
110 internal::Optional<bool> tap_to_click_; 114 internal::Optional<bool> tap_to_click_;
111 internal::Optional<bool> three_finger_click_; 115 internal::Optional<bool> three_finger_click_;
112 internal::Optional<bool> tap_dragging_; 116 internal::Optional<bool> tap_dragging_;
113 internal::Optional<bool> natural_scroll_; 117 internal::Optional<bool> natural_scroll_;
114 }; 118 };
115 119
116 // Auxiliary class used to update several mouse settings at a time. User 120 // Auxiliary class used to update several mouse settings at a time. User
117 // should set any number of settings and pass object to UpdateMouseSettings 121 // should set any number of settings and pass object to UpdateMouseSettings
118 // method of InputDeviceSettings. 122 // method of InputDeviceSettings.
119 // Objects of this class have no default values for settings, so it is error 123 // Objects of this class have no default values for settings, so it is error
120 // to call Get* method before calling corresponding Set* method at least 124 // to call Get* method before calling corresponding Set* method at least
121 // once. 125 // once.
122 class MouseSettings { 126 class MouseSettings {
123 public: 127 public:
124 MouseSettings(); 128 MouseSettings();
125 MouseSettings& operator=(const MouseSettings& other); 129 MouseSettings& operator=(const MouseSettings& other);
126 130
127 void SetSensitivity(int value); 131 void SetSensitivity(int value);
128 int GetSensitivity() const; 132 int GetSensitivity() const;
129 133
130 void SetPrimaryButtonRight(bool right); 134 void SetPrimaryButtonRight(bool right);
131 bool GetPrimaryButtonRight() const; 135 bool GetPrimaryButtonRight() const;
132 136
133 // Updates |this| with |settings|. If at least one setting was updated returns 137 #if defined(USE_OZONE)
138 » // Updates |this| with |update|. If at least one settings was updated, c onfigures all associated ozone event converters appropriately for the new settin g.
139 bool Update(const MouseSettings& update);
140 #else
141 // Updates |this| with |update|. If at least one setting was updated returns
134 // true. 142 // true.
135 // |argv| is filled with arguments of script, that should be launched in order 143 // |argv| is filled with arguments of script, that should be launched in order
136 // to apply update. This argument is optional and could be NULL. 144 // to apply update. This argument is optional and could be NULL.
137 bool Update(const MouseSettings& update, std::vector<std::string>* argv); 145 bool Update(const MouseSettings& update, std::vector<std::string>* argv);
146 #endif
138 147
139 private: 148 private:
140 internal::Optional<int> sensitivity_; 149 internal::Optional<int> sensitivity_;
141 internal::Optional<bool> primary_button_right_; 150 internal::Optional<bool> primary_button_right_;
142 }; 151 };
143 152
144 class InputDeviceSettings { 153 class InputDeviceSettings {
145 public: 154 public:
146 typedef base::Callback<void(bool)> DeviceExistsCallback; 155 typedef base::Callback<void(bool)> DeviceExistsCallback;
147 156
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 virtual void ReapplyTouchpadSettings() = 0; 212 virtual void ReapplyTouchpadSettings() = 0;
204 213
205 // Reapplies previously set mouse settings. 214 // Reapplies previously set mouse settings.
206 virtual void ReapplyMouseSettings() = 0; 215 virtual void ReapplyMouseSettings() = 0;
207 }; 216 };
208 217
209 } // namespace system 218 } // namespace system
210 } // namespace chromeos 219 } // namespace chromeos
211 220
212 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_ 221 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_INPUT_DEVICE_SETTINGS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/system/input_device_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698