OLD | NEW |
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 #include "ui/events/gestures/motion_event_aura.h" | 5 #include "ui/events/gestures/motion_event_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/events/gestures/gesture_configuration.h" | 8 #include "ui/events/gestures/gesture_configuration.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 float MotionEventAura::GetTouchMajor(size_t pointer_index) const { | 119 float MotionEventAura::GetTouchMajor(size_t pointer_index) const { |
120 DCHECK_LE(pointer_index, pointer_count_); | 120 DCHECK_LE(pointer_index, pointer_count_); |
121 return active_touches_[pointer_index].major_radius * 2; | 121 return active_touches_[pointer_index].major_radius * 2; |
122 } | 122 } |
123 | 123 |
124 float MotionEventAura::GetPressure(size_t pointer_index) const { | 124 float MotionEventAura::GetPressure(size_t pointer_index) const { |
125 DCHECK_LE(pointer_index, pointer_count_); | 125 DCHECK_LE(pointer_index, pointer_count_); |
126 return active_touches_[pointer_index].pressure; | 126 return active_touches_[pointer_index].pressure; |
127 } | 127 } |
128 | 128 |
129 base::TimeTicks MotionEventAura::GetEventTime() const { | |
130 return last_touch_time_; | |
131 } | |
132 | |
133 size_t MotionEventAura::GetHistorySize() const { return 0; } | |
134 | |
135 base::TimeTicks MotionEventAura::GetHistoricalEventTime( | |
136 size_t historical_index) const { | |
137 NOTIMPLEMENTED(); | |
138 return base::TimeTicks(); | |
139 } | |
140 | |
141 float MotionEventAura::GetHistoricalTouchMajor(size_t pointer_index, | |
142 size_t historical_index) const { | |
143 NOTIMPLEMENTED(); | |
144 return 0; | |
145 } | |
146 | |
147 float MotionEventAura::GetHistoricalX(size_t pointer_index, | |
148 size_t historical_index) const { | |
149 NOTIMPLEMENTED(); | |
150 return 0; | |
151 } | |
152 | |
153 float MotionEventAura::GetHistoricalY(size_t pointer_index, | |
154 size_t historical_index) const { | |
155 NOTIMPLEMENTED(); | |
156 return 0; | |
157 } | |
158 | |
159 MotionEvent::ToolType MotionEventAura::GetToolType(size_t pointer_index) const { | 129 MotionEvent::ToolType MotionEventAura::GetToolType(size_t pointer_index) const { |
160 NOTIMPLEMENTED(); | 130 NOTIMPLEMENTED(); |
161 return MotionEvent::TOOL_TYPE_UNKNOWN; | 131 return MotionEvent::TOOL_TYPE_UNKNOWN; |
162 } | 132 } |
163 | 133 |
164 int MotionEventAura::GetButtonState() const { | 134 int MotionEventAura::GetButtonState() const { |
165 NOTIMPLEMENTED(); | 135 NOTIMPLEMENTED(); |
166 return 0; | 136 return 0; |
167 } | 137 } |
168 | 138 |
| 139 base::TimeTicks MotionEventAura::GetEventTime() const { |
| 140 return last_touch_time_; |
| 141 } |
| 142 |
169 scoped_ptr<MotionEvent> MotionEventAura::Clone() const { | 143 scoped_ptr<MotionEvent> MotionEventAura::Clone() const { |
170 return scoped_ptr<MotionEvent>(new MotionEventAura(pointer_count_, | 144 return scoped_ptr<MotionEvent>(new MotionEventAura(pointer_count_, |
171 last_touch_time_, | 145 last_touch_time_, |
172 cached_action_, | 146 cached_action_, |
173 cached_action_index_, | 147 cached_action_index_, |
174 active_touches_)); | 148 active_touches_)); |
175 } | 149 } |
176 scoped_ptr<MotionEvent> MotionEventAura::Cancel() const { | 150 scoped_ptr<MotionEvent> MotionEventAura::Cancel() const { |
177 return scoped_ptr<MotionEvent>(new MotionEventAura( | 151 return scoped_ptr<MotionEvent>(new MotionEventAura( |
178 pointer_count_, last_touch_time_, ACTION_CANCEL, -1, active_touches_)); | 152 pointer_count_, last_touch_time_, ACTION_CANCEL, -1, active_touches_)); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 size_t MotionEventAura::GetIndexFromId(int id) const { | 230 size_t MotionEventAura::GetIndexFromId(int id) const { |
257 for (size_t i = 0; i < pointer_count_; ++i) { | 231 for (size_t i = 0; i < pointer_count_; ++i) { |
258 if (active_touches_[i].touch_id == id) | 232 if (active_touches_[i].touch_id == id) |
259 return i; | 233 return i; |
260 } | 234 } |
261 NOTREACHED(); | 235 NOTREACHED(); |
262 return 0; | 236 return 0; |
263 } | 237 } |
264 | 238 |
265 } // namespace ui | 239 } // namespace ui |
OLD | NEW |