OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H | 5 #ifndef ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H |
6 #define ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H | 6 #define ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H |
7 | 7 |
8 namespace ash { | 8 namespace ash { |
9 | 9 |
10 // The default wait time between last mouse movement and sending the autoclick. | |
11 const int kDefaultAutoclickDelayMs = 500; | |
oshima
2013/10/15 17:04:48
can you move this to static memeber of AutoclickCO
Tim Song
2013/10/15 22:23:31
Done.
| |
12 | |
10 // Controls the autoclick a11y feature in ash. | 13 // Controls the autoclick a11y feature in ash. |
11 // If enabled, we will automatically send a click event a short time after | 14 // If enabled, we will automatically send a click event a short time after |
12 // the mouse had been at rest. | 15 // the mouse had been at rest. |
13 class AutoclickController { | 16 class AutoclickController { |
14 public: | 17 public: |
15 virtual ~AutoclickController() {} | 18 virtual ~AutoclickController() {} |
16 | 19 |
17 // Set whether autoclicking is enabled. | 20 // Set whether autoclicking is enabled. |
18 virtual void SetEnabled(bool enabled) = 0; | 21 virtual void SetEnabled(bool enabled) = 0; |
19 | 22 |
20 // Returns true if autoclicking is enabled. | 23 // Returns true if autoclicking is enabled. |
21 virtual bool IsEnabled() const = 0; | 24 virtual bool IsEnabled() const = 0; |
22 | 25 |
23 // Set the time to wait from when the mouse stops moving to when | 26 // Set the time to wait in milliseconds from when the mouse stops moving |
24 // the autoclick event is sent. | 27 // to when the autoclick event is sent. |
25 virtual void SetClickWaitTime(int wait_time_ms) = 0; | 28 virtual void SetAutoclickDelay(int delay_ms) = 0; |
26 | 29 |
27 // Returns the wait time in milliseconds. | 30 // Returns the autoclick delay in milliseconds. |
28 virtual int GetClickWaitTime() const = 0; | 31 virtual int GetAutoclickDelay() const = 0; |
29 | 32 |
30 static AutoclickController* CreateInstance(); | 33 static AutoclickController* CreateInstance(); |
31 | 34 |
32 protected: | 35 protected: |
33 AutoclickController() {} | 36 AutoclickController() {} |
34 }; | 37 }; |
35 | 38 |
36 } // namespace ash | 39 } // namespace ash |
37 | 40 |
38 #endif // ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H | 41 #endif // ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H |
OLD | NEW |