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

Unified Diff: ui/events/gesture_event_details.h

Issue 289373009: Support tap_count in ui::GestureProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Jared's comments. Created 6 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/events/gesture_detection/gesture_detector.cc ('k') | ui/events/gestures/gesture_provider_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_event_details.h
diff --git a/ui/events/gesture_event_details.h b/ui/events/gesture_event_details.h
index fb897b2fce308bf0b2154080df1a7921daff79f7..9b4afca806be10eaf70947ea700c53fa9554bc6b 100644
--- a/ui/events/gesture_event_details.h
+++ b/ui/events/gesture_event_details.h
@@ -35,79 +35,86 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
void set_bounding_box(const gfx::RectF& box) { bounding_box_ = box; }
float scroll_x_hint() const {
- DCHECK_EQ(ui::ET_GESTURE_SCROLL_BEGIN, type_);
+ DCHECK_EQ(ET_GESTURE_SCROLL_BEGIN, type_);
return data.scroll_begin.x_hint;
}
float scroll_y_hint() const {
- DCHECK_EQ(ui::ET_GESTURE_SCROLL_BEGIN, type_);
+ DCHECK_EQ(ET_GESTURE_SCROLL_BEGIN, type_);
return data.scroll_begin.y_hint;
}
float scroll_x() const {
- DCHECK_EQ(ui::ET_GESTURE_SCROLL_UPDATE, type_);
+ DCHECK_EQ(ET_GESTURE_SCROLL_UPDATE, type_);
return data.scroll_update.x;
}
float scroll_y() const {
- DCHECK_EQ(ui::ET_GESTURE_SCROLL_UPDATE, type_);
+ DCHECK_EQ(ET_GESTURE_SCROLL_UPDATE, type_);
return data.scroll_update.y;
}
float velocity_x() const {
- DCHECK(type_ == ui::ET_SCROLL_FLING_START);
+ DCHECK(type_ == ET_SCROLL_FLING_START);
jdduke (slow) 2014/05/22 14:43:33 Super nit, should we make the checks here and in v
tdresser 2014/05/22 14:55:58 Done.
return data.fling_velocity.x;
}
float velocity_y() const {
- DCHECK(type_ == ui::ET_SCROLL_FLING_START);
+ DCHECK(type_ == ET_SCROLL_FLING_START);
return data.fling_velocity.y;
}
float first_finger_width() const {
- DCHECK_EQ(ui::ET_GESTURE_TWO_FINGER_TAP, type_);
+ DCHECK_EQ(ET_GESTURE_TWO_FINGER_TAP, type_);
return data.first_finger_enclosing_rectangle.width;
}
float first_finger_height() const {
- DCHECK_EQ(ui::ET_GESTURE_TWO_FINGER_TAP, type_);
+ DCHECK_EQ(ET_GESTURE_TWO_FINGER_TAP, type_);
return data.first_finger_enclosing_rectangle.height;
}
float scale() const {
- DCHECK_EQ(ui::ET_GESTURE_PINCH_UPDATE, type_);
+ DCHECK_EQ(ET_GESTURE_PINCH_UPDATE, type_);
return data.scale;
}
bool swipe_left() const {
- DCHECK_EQ(ui::ET_GESTURE_MULTIFINGER_SWIPE, type_);
+ DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_);
return data.swipe.left;
}
bool swipe_right() const {
- DCHECK_EQ(ui::ET_GESTURE_MULTIFINGER_SWIPE, type_);
+ DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_);
return data.swipe.right;
}
bool swipe_up() const {
- DCHECK_EQ(ui::ET_GESTURE_MULTIFINGER_SWIPE, type_);
+ DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_);
return data.swipe.up;
}
bool swipe_down() const {
- DCHECK_EQ(ui::ET_GESTURE_MULTIFINGER_SWIPE, type_);
+ DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_);
return data.swipe.down;
}
int tap_count() const {
- DCHECK(type_ == ui::ET_GESTURE_TAP ||
- type_ == ui::ET_GESTURE_TAP_UNCONFIRMED ||
+ DCHECK(type_ == ET_GESTURE_TAP ||
+ type_ == ET_GESTURE_TAP_UNCONFIRMED ||
type_ == ET_GESTURE_DOUBLE_TAP);
return data.tap_count;
}
+ void set_tap_count(int tap_count) {
+ DCHECK(type_ == ET_GESTURE_TAP ||
+ type_ == ET_GESTURE_TAP_UNCONFIRMED ||
+ type_ == ET_GESTURE_DOUBLE_TAP);
+ data.tap_count = tap_count;
+ }
+
private:
- ui::EventType type_;
+ EventType type_;
union Details {
Details();
struct { // SCROLL start details.
« no previous file with comments | « ui/events/gesture_detection/gesture_detector.cc ('k') | ui/events/gestures/gesture_provider_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698