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

Side by Side Diff: ui/events/event_utils.h

Issue 400213002: Refcount touch tracking ids to prevent freeing them too early. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix non-linux platforms. 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
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 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 "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/events/event_constants.h" 10 #include "ui/events/event_constants.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 base::NativeEvent CopyNativeEvent( 99 base::NativeEvent CopyNativeEvent(
100 const base::NativeEvent& native_event); 100 const base::NativeEvent& native_event);
101 101
102 // Delete a |native_event| previously created by CopyNativeEvent(). 102 // Delete a |native_event| previously created by CopyNativeEvent().
103 void ReleaseCopiedNativeEvent( 103 void ReleaseCopiedNativeEvent(
104 const base::NativeEvent& native_event); 104 const base::NativeEvent& native_event);
105 105
106 // Gets the touch id from a native event. 106 // Gets the touch id from a native event.
107 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); 107 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event);
108 108
109 // Increases the number of times |ClearTouchIdIfReleased| needs to be called on
110 // an event with a given touch id before it will actually be cleared.
111 EVENTS_EXPORT void IncrementTouchIdRefCount(
112 const base::NativeEvent& native_event);
113
109 // Clear the touch id from bookkeeping if it is a release/cancel event. 114 // Clear the touch id from bookkeeping if it is a release/cancel event.
110 EVENTS_EXPORT void ClearTouchIdIfReleased( 115 EVENTS_EXPORT void ClearTouchIdIfReleased(
111 const base::NativeEvent& native_event); 116 const base::NativeEvent& native_event);
112 117
113 // Gets the radius along the X/Y axis from a native event. Default is 1.0. 118 // Gets the radius along the X/Y axis from a native event. Default is 1.0.
114 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); 119 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event);
115 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); 120 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event);
116 121
117 // Gets the angle of the major axis away from the X axis. Default is 0.0. 122 // Gets the angle of the major axis away from the X axis. Default is 0.0.
118 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); 123 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); 172 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code);
168 173
169 #endif 174 #endif
170 175
171 // Registers a custom event type. 176 // Registers a custom event type.
172 EVENTS_EXPORT int RegisterCustomEventType(); 177 EVENTS_EXPORT int RegisterCustomEventType();
173 178
174 } // namespace ui 179 } // namespace ui
175 180
176 #endif // UI_EVENTS_EVENT_UTILS_H_ 181 #endif // UI_EVENTS_EVENT_UTILS_H_
OLDNEW
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/events_stub.cc » ('j') | ui/events/x/events_x.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698