OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/web_input_event_util.h" | 8 #include "content/browser/renderer_host/input/web_input_event_util.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
11 | 11 |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "content/common/input/web_touch_event_traits.h" | 13 #include "content/common/input/web_touch_event_traits.h" |
14 #include "ui/events/blink/blink_event_util.h" | 14 #include "ui/events/blink/blink_event_util.h" |
15 #include "ui/events/event_constants.h" | 15 #include "ui/events/event_constants.h" |
16 #include "ui/events/gesture_detection/gesture_event_data.h" | 16 #include "ui/events/gesture_detection/gesture_event_data.h" |
17 #include "ui/events/gesture_detection/motion_event.h" | 17 #include "ui/events/gesture_detection/motion_event.h" |
18 #include "ui/events/keycodes/dom/keycode_converter.h" | |
19 #include "ui/gfx/geometry/safe_integer_conversions.h" | 18 #include "ui/gfx/geometry/safe_integer_conversions.h" |
20 | 19 |
21 using blink::WebGestureEvent; | 20 using blink::WebGestureEvent; |
22 using blink::WebInputEvent; | 21 using blink::WebInputEvent; |
23 using blink::WebTouchEvent; | 22 using blink::WebTouchEvent; |
24 using blink::WebTouchPoint; | 23 using blink::WebTouchPoint; |
25 using ui::MotionEvent; | 24 using ui::MotionEvent; |
26 | 25 |
27 namespace { | 26 namespace { |
28 | 27 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (modifiers & blink::WebInputEvent::RightButtonDown) | 180 if (modifiers & blink::WebInputEvent::RightButtonDown) |
182 flags |= ui::EF_RIGHT_MOUSE_BUTTON; | 181 flags |= ui::EF_RIGHT_MOUSE_BUTTON; |
183 if (modifiers & blink::WebInputEvent::CapsLockOn) | 182 if (modifiers & blink::WebInputEvent::CapsLockOn) |
184 flags |= ui::EF_CAPS_LOCK_DOWN; | 183 flags |= ui::EF_CAPS_LOCK_DOWN; |
185 if (modifiers & blink::WebInputEvent::IsAutoRepeat) | 184 if (modifiers & blink::WebInputEvent::IsAutoRepeat) |
186 flags |= ui::EF_IS_REPEAT; | 185 flags |= ui::EF_IS_REPEAT; |
187 | 186 |
188 return flags; | 187 return flags; |
189 } | 188 } |
190 | 189 |
191 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers( | |
192 ui::DomCode code) { | |
193 switch (ui::KeycodeConverter::DomCodeToLocation(code)) { | |
194 case ui::DomKeyLocation::LEFT: | |
195 return blink::WebInputEvent::IsLeft; | |
196 case ui::DomKeyLocation::RIGHT: | |
197 return blink::WebInputEvent::IsRight; | |
198 case ui::DomKeyLocation::NUMPAD: | |
199 return blink::WebInputEvent::IsKeyPad; | |
200 case ui::DomKeyLocation::STANDARD: | |
201 break; | |
202 } | |
203 return static_cast<blink::WebInputEvent::Modifiers>(0); | |
204 } | |
205 | |
206 } // namespace content | 190 } // namespace content |
OLD | NEW |