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

Unified Diff: ui/aura/event.h

Issue 9773024: This patch implements Chromium's Aura gesture recognizer in terms of utouch-grail and utouch-frame … (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 9 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
Index: ui/aura/event.h
===================================================================
--- ui/aura/event.h (revision 126124)
+++ ui/aura/event.h (working copy)
@@ -294,8 +294,7 @@
int flags)
: MouseEvent(model, source, target, type, flags),
x_offset_(model.x_offset_),
- y_offset_(model.y_offset_) {
- }
+ y_offset_(model.y_offset_) {}
float x_offset() const { return x_offset_; }
float y_offset() const { return y_offset_; }
@@ -309,6 +308,23 @@
class AURA_EXPORT GestureEvent : public LocatedEvent {
public:
+ struct Properties {
tdresser 2012/03/29 17:44:38 If this is being refactored, we should update the
+ Properties()
+ : delta_x(0.f),
+ delta_y(0.f),
+ scale_x(1.f),
+ scale_y(1.f) {
+ }
+
+ // For drag gestures
+ float delta_x;
+ float delta_y;
+
+ // For pinch gestures
+ float scale_x;
+ float scale_y;
+ };
+
GestureEvent(ui::EventType type,
int x,
int y,
@@ -317,17 +333,28 @@
float delta_x,
float delta_y);
+ GestureEvent(ui::EventType type,
+ int x,
+ int y,
+ int flags,
+ base::Time time_stamp,
+ const Properties& properties);
+
// Create a new TouchEvent which is identical to the provided model.
// If source / target windows are provided, the model location will be
// converted from |source| coordinate system to |target| coordinate system.
GestureEvent(const GestureEvent& model, Window* source, Window* target);
- float delta_x() const { return delta_x_; }
- float delta_y() const { return delta_y_; }
+ float delta_x() const { return properties_.delta_x; }
+ float delta_y() const { return properties_.delta_y; }
+ float scale_x() const { return properties_.scale_x; }
+ float scale_y() const { return properties_.scale_y; }
+
+ const Properties& properties() const { return properties_; }
+
private:
- float delta_x_;
- float delta_y_;
+ Properties properties_;
DISALLOW_COPY_AND_ASSIGN(GestureEvent);
};

Powered by Google App Engine
This is Rietveld 408576698