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

Side by Side Diff: ui/events/gesture_detection/mock_motion_event.cc

Issue 348813002: Extend MotionEvent to have tool type and button state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 6 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 #include "ui/events/gesture_detection/mock_motion_event.h" 5 #include "ui/events/gesture_detection/mock_motion_event.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 using base::TimeTicks; 9 using base::TimeTicks;
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 float MockMotionEvent::GetHistoricalX(size_t pointer_index, 133 float MockMotionEvent::GetHistoricalX(size_t pointer_index,
134 size_t historical_index) const { 134 size_t historical_index) const {
135 return 0; 135 return 0;
136 } 136 }
137 137
138 float MockMotionEvent::GetHistoricalY(size_t pointer_index, 138 float MockMotionEvent::GetHistoricalY(size_t pointer_index,
139 size_t historical_index) const { 139 size_t historical_index) const {
140 return 0; 140 return 0;
141 } 141 }
142 142
143 MotionEvent::ToolType MockMotionEvent::GetToolType(size_t pointer_index) const {
144 return MotionEvent::TOOL_TYPE_UNKNOWN;
145 }
146
147 int MockMotionEvent::GetButtonState() const {
148 return 0;
149 }
150
143 scoped_ptr<MotionEvent> MockMotionEvent::Clone() const { 151 scoped_ptr<MotionEvent> MockMotionEvent::Clone() const {
144 return scoped_ptr<MotionEvent>(new MockMotionEvent(*this)); 152 return scoped_ptr<MotionEvent>(new MockMotionEvent(*this));
145 } 153 }
146 154
147 scoped_ptr<MotionEvent> MockMotionEvent::Cancel() const { 155 scoped_ptr<MotionEvent> MockMotionEvent::Cancel() const {
148 scoped_ptr<MockMotionEvent> cancel_event(new MockMotionEvent(*this)); 156 scoped_ptr<MockMotionEvent> cancel_event(new MockMotionEvent(*this));
149 cancel_event->action = MotionEvent::ACTION_CANCEL; 157 cancel_event->action = MotionEvent::ACTION_CANCEL;
150 return cancel_event.PassAs<MotionEvent>(); 158 return cancel_event.PassAs<MotionEvent>();
151 } 159 }
152 160
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 void MockMotionEvent::SetTouchMajor(float new_touch_major) { 203 void MockMotionEvent::SetTouchMajor(float new_touch_major) {
196 touch_major = new_touch_major; 204 touch_major = new_touch_major;
197 } 205 }
198 206
199 void MockMotionEvent::SetRawOffset(float raw_offset_x, float raw_offset_y) { 207 void MockMotionEvent::SetRawOffset(float raw_offset_x, float raw_offset_y) {
200 raw_offset.set_x(raw_offset_x); 208 raw_offset.set_x(raw_offset_x);
201 raw_offset.set_y(raw_offset_y); 209 raw_offset.set_y(raw_offset_y);
202 } 210 }
203 211
204 } // namespace ui 212 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/mock_motion_event.h ('k') | ui/events/gesture_detection/motion_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698