| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "ui/events/events_base_export.h" | 10 #include "ui/events/events_base_export.h" |
| 11 | 11 |
| 12 namespace base { |
| 13 class TimeTicks; |
| 14 } |
| 15 |
| 12 // Common functions to be used for all platforms. | 16 // Common functions to be used for all platforms. |
| 13 namespace ui { | 17 namespace ui { |
| 14 | 18 |
| 15 // Generate an unique identifier for events. | 19 // Generate an unique identifier for events. |
| 16 EVENTS_BASE_EXPORT uint32_t GetNextTouchEventId(); | 20 EVENTS_BASE_EXPORT uint32_t GetNextTouchEventId(); |
| 17 | 21 |
| 18 // Checks if |flags| contains system key modifiers. | 22 // Checks if |flags| contains system key modifiers. |
| 19 EVENTS_BASE_EXPORT bool IsSystemKeyModifier(int flags); | 23 EVENTS_BASE_EXPORT bool IsSystemKeyModifier(int flags); |
| 20 | 24 |
| 25 // Converts an event timestamp ticks to seconds (floating point representation). |
| 26 // WARNING: This should only be used when interfacing with platform code that |
| 27 // does not use base::Time* types. |
| 28 EVENTS_BASE_EXPORT double EventTimeStampToSeconds(base::TimeTicks time_stamp); |
| 29 |
| 30 // Converts an event timestamp in seconds to TimeTicks. |
| 31 // WARNING: This should only be used when interfacing with platform code that |
| 32 // does not use base::Time* types. |
| 33 EVENTS_BASE_EXPORT base::TimeTicks EventTimeStampFromSeconds( |
| 34 double time_stamp_seconds); |
| 35 |
| 21 } // namespace ui | 36 } // namespace ui |
| 22 | 37 |
| 23 #endif // UI_EVENTS_BASE_EVENT_UTILS_H_ | 38 #endif // UI_EVENTS_BASE_EVENT_UTILS_H_ |
| OLD | NEW |