OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 UI_EVENTS_BASE_EVENT_UTILS_H_ | 5 #ifndef UI_EVENTS_BASE_EVENT_UTILS_H_ |
6 #define UI_EVENTS_BASE_EVENT_UTILS_H_ | 6 #define UI_EVENTS_BASE_EVENT_UTILS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/events/events_base_export.h" | 9 #include "ui/events/events_base_export.h" |
10 | 10 |
11 // Common functions to be used for all platforms. | 11 // Common functions to be used for all platforms. |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 // Generate an unique identifier for events. | 14 // Generate an unique identifier for events. |
15 EVENTS_BASE_EXPORT uint32 GetNextTouchEventId(); | 15 EVENTS_BASE_EXPORT uint32 GetNextTouchEventId(); |
16 | 16 |
17 // Checks if |flags| contains system key modifiers. | 17 // Checks if |flags| contains system key modifiers. |
18 EVENTS_BASE_EXPORT bool IsSystemKeyModifier(int flags); | 18 EVENTS_BASE_EXPORT bool IsSystemKeyModifier(int flags); |
19 | 19 |
20 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
21 // Sets the status of touch events to |enabled| on ChromeOS only. Non-ChromeOS | 21 // Sets the status of touch events to |enabled| on ChromeOS only. |
22 // platforms depend on the state of the |kTouchEvents| flags. | |
23 EVENTS_BASE_EXPORT void SetTouchEventsEnabled(bool enabled); | 22 EVENTS_BASE_EXPORT void SetTouchEventsEnabled(bool enabled); |
24 #endif // defined(OS_CHROMEOS) | 23 #endif // defined(OS_CHROMEOS) |
25 | 24 |
26 // Returns true if the touch events are enabled. On non-ChromeOS platforms, this | 25 // Returns true if the touch events are enabled. On non-ChromeOS platforms, this |
27 // depends on the state of the |kTouchEvents| flags. | 26 // depends only on the state of the |kTouchEvents| flag. On ChromeOS, it also |
| 27 // depends on the value set using the above function. |
28 EVENTS_BASE_EXPORT bool AreTouchEventsEnabled(); | 28 EVENTS_BASE_EXPORT bool AreTouchEventsEnabled(); |
29 | 29 |
30 } // namespace ui | 30 } // namespace ui |
31 | 31 |
32 #endif // UI_EVENTS_BASE_EVENT_UTILS_H_ | 32 #endif // UI_EVENTS_BASE_EVENT_UTILS_H_ |
OLD | NEW |