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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "content/browser/renderer_host/input/motion_event_web.h" | 8 #include "content/browser/renderer_host/input/motion_event_web.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 const WebPointerProperties& pointer = event_.touches[pointer_index]; | 199 const WebPointerProperties& pointer = event_.touches[pointer_index]; |
200 | 200 |
201 switch (pointer.pointerType) { | 201 switch (pointer.pointerType) { |
202 case WebPointerProperties::PointerType::Unknown: | 202 case WebPointerProperties::PointerType::Unknown: |
203 return TOOL_TYPE_UNKNOWN; | 203 return TOOL_TYPE_UNKNOWN; |
204 case WebPointerProperties::PointerType::Mouse: | 204 case WebPointerProperties::PointerType::Mouse: |
205 return TOOL_TYPE_MOUSE; | 205 return TOOL_TYPE_MOUSE; |
206 case WebPointerProperties::PointerType::Pen: | 206 case WebPointerProperties::PointerType::Pen: |
207 return TOOL_TYPE_STYLUS; | 207 return TOOL_TYPE_STYLUS; |
| 208 case WebPointerProperties::PointerType::Eraser: |
| 209 return TOOL_TYPE_ERASER; |
208 case WebPointerProperties::PointerType::Touch: | 210 case WebPointerProperties::PointerType::Touch: |
209 return TOOL_TYPE_FINGER; | 211 return TOOL_TYPE_FINGER; |
210 } | 212 } |
211 NOTREACHED() << "Unexpected pointerType"; | 213 NOTREACHED() << "Unexpected pointerType"; |
212 return TOOL_TYPE_UNKNOWN; | 214 return TOOL_TYPE_UNKNOWN; |
213 } | 215 } |
214 | 216 |
215 int MotionEventWeb::GetButtonState() const { | 217 int MotionEventWeb::GetButtonState() const { |
216 return 0; | 218 return 0; |
217 } | 219 } |
218 | 220 |
219 int MotionEventWeb::GetFlags() const { | 221 int MotionEventWeb::GetFlags() const { |
220 return ui::WebEventModifiersToEventFlags(event_.modifiers); | 222 return ui::WebEventModifiersToEventFlags(event_.modifiers); |
221 } | 223 } |
222 | 224 |
223 } // namespace content | 225 } // namespace content |
OLD | NEW |