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

Side by Side Diff: ui/events/gesture_detection/motion_event_generic.h

Issue 999423003: Set the unique_event_id when converting from TouchEvent to WebTouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_
6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/containers/stack_container.h" 9 #include "base/containers/stack_container.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 26 matching lines...) Expand all
37 public: 37 public:
38 MotionEventGeneric(Action action, 38 MotionEventGeneric(Action action,
39 base::TimeTicks event_time, 39 base::TimeTicks event_time,
40 const PointerProperties& pointer); 40 const PointerProperties& pointer);
41 MotionEventGeneric(const MotionEventGeneric& other); 41 MotionEventGeneric(const MotionEventGeneric& other);
42 42
43 ~MotionEventGeneric() override; 43 ~MotionEventGeneric() override;
44 44
45 // MotionEvent implementation. 45 // MotionEvent implementation.
46 int GetId() const override; 46 int GetId() const override;
47 uint64 GetUniqueId() const override;
47 Action GetAction() const override; 48 Action GetAction() const override;
48 int GetActionIndex() const override; 49 int GetActionIndex() const override;
49 size_t GetPointerCount() const override; 50 size_t GetPointerCount() const override;
50 int GetPointerId(size_t pointer_index) const override; 51 int GetPointerId(size_t pointer_index) const override;
51 float GetX(size_t pointer_index) const override; 52 float GetX(size_t pointer_index) const override;
52 float GetY(size_t pointer_index) const override; 53 float GetY(size_t pointer_index) const override;
53 float GetRawX(size_t pointer_index) const override; 54 float GetRawX(size_t pointer_index) const override;
54 float GetRawY(size_t pointer_index) const override; 55 float GetRawY(size_t pointer_index) const override;
55 float GetTouchMajor(size_t pointer_index) const override; 56 float GetTouchMajor(size_t pointer_index) const override;
56 float GetTouchMinor(size_t pointer_index) const override; 57 float GetTouchMinor(size_t pointer_index) const override;
(...skipping 24 matching lines...) Expand all
81 return pointers_[index]; 82 return pointers_[index];
82 } 83 }
83 84
84 // Add an event to the history. |this| and |event| must have the same pointer 85 // Add an event to the history. |this| and |event| must have the same pointer
85 // count and must both have an action of ACTION_MOVE. 86 // count and must both have an action of ACTION_MOVE.
86 void PushHistoricalEvent(scoped_ptr<MotionEvent> event); 87 void PushHistoricalEvent(scoped_ptr<MotionEvent> event);
87 88
88 void set_action(Action action) { action_ = action; } 89 void set_action(Action action) { action_ = action; }
89 void set_event_time(base::TimeTicks event_time) { event_time_ = event_time; } 90 void set_event_time(base::TimeTicks event_time) { event_time_ = event_time; }
90 void set_id(int id) { id_ = id; } 91 void set_id(int id) { id_ = id; }
92 void set_unique_id(uint64 unique_id) { unique_id_ = unique_id; }
91 void set_action_index(int action_index) { action_index_ = action_index; } 93 void set_action_index(int action_index) { action_index_ = action_index; }
92 void set_button_state(int button_state) { button_state_ = button_state; } 94 void set_button_state(int button_state) { button_state_ = button_state; }
93 void set_flags(int flags) { flags_ = flags; } 95 void set_flags(int flags) { flags_ = flags; }
94 96
95 static scoped_ptr<MotionEventGeneric> CloneEvent(const MotionEvent& event); 97 static scoped_ptr<MotionEventGeneric> CloneEvent(const MotionEvent& event);
96 static scoped_ptr<MotionEventGeneric> CancelEvent(const MotionEvent& event); 98 static scoped_ptr<MotionEventGeneric> CancelEvent(const MotionEvent& event);
97 99
98 protected: 100 protected:
99 MotionEventGeneric(); 101 MotionEventGeneric();
100 MotionEventGeneric(const MotionEvent& event, bool with_history); 102 MotionEventGeneric(const MotionEvent& event, bool with_history);
101 MotionEventGeneric& operator=(const MotionEventGeneric& other); 103 MotionEventGeneric& operator=(const MotionEventGeneric& other);
102 104
103 void PopPointer(); 105 void PopPointer();
104 106
105 private: 107 private:
106 enum { kTypicalMaxPointerCount = 5 }; 108 enum { kTypicalMaxPointerCount = 5 };
107 109
108 Action action_; 110 Action action_;
109 base::TimeTicks event_time_; 111 base::TimeTicks event_time_;
110 int id_; 112 int id_;
113 uint64 unique_id_;
111 int action_index_; 114 int action_index_;
112 int button_state_; 115 int button_state_;
113 int flags_; 116 int flags_;
114 base::StackVector<PointerProperties, kTypicalMaxPointerCount> pointers_; 117 base::StackVector<PointerProperties, kTypicalMaxPointerCount> pointers_;
115 ScopedVector<MotionEvent> historical_events_; 118 ScopedVector<MotionEvent> historical_events_;
116 }; 119 };
117 120
118 } // namespace ui 121 } // namespace ui
119 122
120 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ 123 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698