Chromium Code Reviews| Index: ui/events/gesture_event_details.h |
| diff --git a/ui/events/gesture_event_details.h b/ui/events/gesture_event_details.h |
| index ff88041fb3eeb38819000f8072b2624938f38aab..f889e0d88a7bf921cff09e9a58074340b3340d26 100644 |
| --- a/ui/events/gesture_event_details.h |
| +++ b/ui/events/gesture_event_details.h |
| @@ -5,7 +5,10 @@ |
| #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ |
| #define UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ |
| +#include <string.h> |
| + |
| #include "base/logging.h" |
| +#include "ipc/ipc_message_utils.h" |
| #include "ui/events/event_constants.h" |
| #include "ui/events/events_base_export.h" |
| #include "ui/gfx/geometry/rect.h" |
| @@ -182,11 +185,24 @@ struct EVENTS_BASE_EXPORT GestureEventDetails { |
| int tap_count; // TAP repeat count. |
| } data_; |
| + // For mojo native implementation of (de)serialization. |
| + friend struct IPC::ParamTraits<ui::GestureEventDetails>; |
| + friend struct IPC::ParamTraits<ui::GestureEventDetails::Details>; |
| + |
| int touch_points_; // Number of active touch points in the gesture. |
| // Bounding box is an axis-aligned rectangle that contains all the |
| // enclosing rectangles of the touch-points in the gesture. |
| gfx::RectF bounding_box_; |
| + |
| + public: |
| + // Supports comparison over internal structures for testing. |
| + bool operator==(const GestureEventDetails& other) const { |
|
Ken Rockot(use gerrit already)
2016/02/17 22:05:21
Maybe it would be better to expose something like
Mark Dittmer
2016/02/18 14:51:05
Could do. There are two reasons I prefer implement
|
| + return type_ == other.type_ && |
| + !memcmp(&data_, &other.data_, sizeof(Details)) && |
| + touch_points_ == other.touch_points_ && |
| + bounding_box_ == other.bounding_box_; |
| + } |
| }; |
| } // namespace ui |