OLD | NEW |
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 UI_EVENTS_EVENT_UTILS_H_ | 5 #ifndef UI_EVENTS_EVENT_UTILS_H_ |
6 #define UI_EVENTS_EVENT_UTILS_H_ | 6 #define UI_EVENTS_EVENT_UTILS_H_ |
7 | 7 |
8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 EVENTS_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, | 117 EVENTS_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, |
118 double* start_time, | 118 double* start_time, |
119 double* end_time); | 119 double* end_time); |
120 | 120 |
121 // Enable/disable natural scrolling for touchpads. | 121 // Enable/disable natural scrolling for touchpads. |
122 EVENTS_EXPORT void SetNaturalScroll(bool enabled); | 122 EVENTS_EXPORT void SetNaturalScroll(bool enabled); |
123 | 123 |
124 // In natural scrolling enabled for touchpads? | 124 // In natural scrolling enabled for touchpads? |
125 EVENTS_EXPORT bool IsNaturalScrollEnabled(); | 125 EVENTS_EXPORT bool IsNaturalScrollEnabled(); |
126 | 126 |
| 127 // Returns whether natural scrolling should be used for touchpad. |
| 128 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); |
| 129 |
127 // Was this event generated by a touchpad device? | 130 // Was this event generated by a touchpad device? |
128 // The caller is responsible for ensuring that this is a mouse/touchpad event | 131 // The caller is responsible for ensuring that this is a mouse/touchpad event |
129 // before calling this function. | 132 // before calling this function. |
130 EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); | 133 EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); |
131 | 134 |
132 // Returns true if event is noop. | 135 // Returns true if event is noop. |
133 EVENTS_EXPORT bool IsNoopEvent(const base::NativeEvent& event); | 136 EVENTS_EXPORT bool IsNoopEvent(const base::NativeEvent& event); |
134 | 137 |
135 // Creates and returns no-op event. | 138 // Creates and returns no-op event. |
136 EVENTS_EXPORT base::NativeEvent CreateNoopEvent(); | 139 EVENTS_EXPORT base::NativeEvent CreateNoopEvent(); |
(...skipping 10 matching lines...) Expand all Loading... |
147 // Returns true if default post-target handling was canceled for |event| after | 150 // Returns true if default post-target handling was canceled for |event| after |
148 // its dispatch to its target. | 151 // its dispatch to its target. |
149 EVENTS_EXPORT bool EventCanceledDefaultHandling(const Event& event); | 152 EVENTS_EXPORT bool EventCanceledDefaultHandling(const Event& event); |
150 | 153 |
151 // Registers a custom event type. | 154 // Registers a custom event type. |
152 EVENTS_EXPORT int RegisterCustomEventType(); | 155 EVENTS_EXPORT int RegisterCustomEventType(); |
153 | 156 |
154 } // namespace ui | 157 } // namespace ui |
155 | 158 |
156 #endif // UI_EVENTS_EVENT_UTILS_H_ | 159 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |