Chromium Code Reviews| 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); |
| }; |