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

Side by Side Diff: ui/events/gestures/motion_event_aura.cc

Issue 2278033003: Revert of Add POINTER_TYPE_ERASER to EventPointerType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « ui/events/event_constants.h ('k') | ui/events/ozone/evdev/tablet_event_converter_evdev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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/gesture_detection/gesture_configuration.h" 8 #include "ui/events/gesture_detection/gesture_configuration.h"
9 9
10 namespace ui { 10 namespace ui {
11 namespace { 11 namespace {
12 12
13 MotionEvent::ToolType EventPointerTypeToMotionEventToolType( 13 MotionEvent::ToolType EventPointerTypeToMotionEventToolType(
14 EventPointerType type) { 14 EventPointerType type) {
15 switch (type) { 15 switch (type) {
16 case EventPointerType::POINTER_TYPE_UNKNOWN: 16 case EventPointerType::POINTER_TYPE_UNKNOWN:
17 return MotionEvent::TOOL_TYPE_UNKNOWN; 17 return MotionEvent::TOOL_TYPE_UNKNOWN;
18 case EventPointerType::POINTER_TYPE_MOUSE: 18 case EventPointerType::POINTER_TYPE_MOUSE:
19 return MotionEvent::TOOL_TYPE_MOUSE; 19 return MotionEvent::TOOL_TYPE_MOUSE;
20 case EventPointerType::POINTER_TYPE_PEN: 20 case EventPointerType::POINTER_TYPE_PEN:
21 return MotionEvent::TOOL_TYPE_STYLUS; 21 return MotionEvent::TOOL_TYPE_STYLUS;
22 case EventPointerType::POINTER_TYPE_TOUCH: 22 case EventPointerType::POINTER_TYPE_TOUCH:
23 return MotionEvent::TOOL_TYPE_FINGER; 23 return MotionEvent::TOOL_TYPE_FINGER;
24 case EventPointerType::POINTER_TYPE_ERASER:
25 return MotionEvent::TOOL_TYPE_ERASER;
26 } 24 }
27 25
28 return MotionEvent::TOOL_TYPE_UNKNOWN; 26 return MotionEvent::TOOL_TYPE_UNKNOWN;
29 } 27 }
30 28
31 PointerProperties GetPointerPropertiesFromTouchEvent(const TouchEvent& touch) { 29 PointerProperties GetPointerPropertiesFromTouchEvent(const TouchEvent& touch) {
32 PointerProperties pointer_properties; 30 PointerProperties pointer_properties;
33 pointer_properties.x = touch.x(); 31 pointer_properties.x = touch.x();
34 pointer_properties.y = touch.y(); 32 pointer_properties.y = touch.y();
35 pointer_properties.raw_x = touch.root_location_f().x(); 33 pointer_properties.raw_x = touch.root_location_f().x();
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 169
172 int MotionEventAura::GetIndexFromId(int id) const { 170 int MotionEventAura::GetIndexFromId(int id) const {
173 int index = FindPointerIndexOfId(id); 171 int index = FindPointerIndexOfId(id);
174 // TODO(tdresser): remove these checks once crbug.com/525189 is fixed. 172 // TODO(tdresser): remove these checks once crbug.com/525189 is fixed.
175 CHECK_GE(index, 0); 173 CHECK_GE(index, 0);
176 CHECK_LT(index, static_cast<int>(GetPointerCount())); 174 CHECK_LT(index, static_cast<int>(GetPointerCount()));
177 return index; 175 return index;
178 } 176 }
179 177
180 } // namespace ui 178 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_constants.h ('k') | ui/events/ozone/evdev/tablet_event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698