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

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: 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 if (pointer_count > 1) 198 if (pointer_count > 1)
191 --pointer_count; 199 --pointer_count;
192 action = ACTION_CANCEL; 200 action = ACTION_CANCEL;
193 } 201 }
194 202
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 } // namespace ui 207 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698