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

Unified Diff: ui/base/gestures/gesture_types.h

Issue 10365009: Adding Gesture Recognition to RenderWidgetHostViewWin (web client) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge cleanup. (Implementing four new virtuals added in the base.) Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/root_window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_types.h
diff --git a/ui/base/gestures/gesture_types.h b/ui/base/gestures/gesture_types.h
index a17792fc1c7a99dfef51dd0eada7ee9b7777e71d..a7175bcfe28c3c9d1078cae54fb93a6aa5fdc7dd 100644
--- a/ui/base/gestures/gesture_types.h
+++ b/ui/base/gestures/gesture_types.h
@@ -40,6 +40,15 @@ class UI_EXPORT GestureEvent {
// A gesture event can have multiple touches. This function should return the
// lowest ID of the touches in this gesture.
virtual int GetLowestTouchId() const = 0;
+
+ // A helper function used in several (all) derived classes.
+ // Returns lowest set bit, or -1 if no bits are set.
+ static int LowestBit(unsigned int bitfield) {
+ int i = -1;
+ // Find the index of the least significant 1 bit
+ while (bitfield && (!((1 << ++i) & bitfield)));
+ return i;
+ }
};
// An abstract type for consumers of gesture-events created by the
@@ -76,7 +85,7 @@ class UI_EXPORT GestureEventHelper {
virtual GestureEvent* CreateGestureEvent(EventType type,
const gfx::Point& location,
int flags,
- const base::Time time,
+ base::Time time,
float param_first,
float param_second,
unsigned int touch_id_bitfield) = 0;
« no previous file with comments | « ui/aura/root_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698