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

Unified Diff: ui/views/events/event.h

Issue 9076002: Initial views touchui Gesture Recognizer support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win release build Created 8 years, 11 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/base/events.h ('k') | ui/views/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/events/event.h
diff --git a/ui/views/events/event.h b/ui/views/events/event.h
index 640e9918cf2fe27e7a47fe3f111fffb64b8ca347..28301142d383ad2842f72e1a617401177dd04f67 100644
--- a/ui/views/events/event.h
+++ b/ui/views/events/event.h
@@ -62,6 +62,10 @@ class VIEWS_EXPORT Event {
#endif
ui::EventType type() const { return type_; }
const base::Time& time_stamp() const { return time_stamp_; }
+
+ // Required for Gesture testing purposes.
+ void set_time_stamp(base::Time time_stamp) { time_stamp_ = time_stamp; }
+
int flags() const { return flags_; }
void set_flags(int flags) { flags_ = flags; }
@@ -419,6 +423,39 @@ class VIEWS_EXPORT ScrollEvent : public MouseEvent {
DISALLOW_COPY_AND_ASSIGN(ScrollEvent);
};
+////////////////////////////////////////////////////////////////////////////////
+// GestureEvent class
+//
+////////////////////////////////////////////////////////////////////////////////
+class VIEWS_EXPORT GestureEvent : public LocatedEvent {
+ public:
+ GestureEvent(ui::EventType type,
+ int x,
+ int y,
+ int flags,
+ base::Time time_stamp,
+ float delta_x,
+ float delta_y);
+
+ // Create a new GestureEvent which is identical to the provided model.
+ // If source / target views are provided, the model location will be converted
+ // from |source| coordinate system to |target| coordinate system.
+ GestureEvent(const GestureEvent& model, View* source, View* target);
+
+ float delta_x() const { return delta_x_; }
+ float delta_y() const { return delta_y_; }
+
+ private:
+ friend class internal::RootView;
+
+ GestureEvent(const GestureEvent& model, View* root);
+
+ float delta_x_;
+ float delta_y_;
+
+ DISALLOW_COPY_AND_ASSIGN(GestureEvent);
+};
+
} // namespace views
#endif // UI_VIEWS_EVENTS_EVENT_H_
« no previous file with comments | « ui/base/events.h ('k') | ui/views/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698