OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/events/blink/blink_event_util.h" | 8 #include "ui/events/blink/blink_event_util.h" |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 #if defined(OS_WIN) | 218 #if defined(OS_WIN) |
219 // Evaluate whether OSKey should be set for other platforms. | 219 // Evaluate whether OSKey should be set for other platforms. |
220 // Since this value was never set on Windows before as the meta | 220 // Since this value was never set on Windows before as the meta |
221 // key; we don't break backwards compatiblity exposing it as the | 221 // key; we don't break backwards compatiblity exposing it as the |
222 // true OS key. However this is not the case for Linux; see | 222 // true OS key. However this is not the case for Linux; see |
223 // http://crbug.com/539979 | 223 // http://crbug.com/539979 |
224 modifiers |= blink::WebInputEvent::OSKey; | 224 modifiers |= blink::WebInputEvent::OSKey; |
225 #else | 225 #else |
226 modifiers |= blink::WebInputEvent::MetaKey; | 226 modifiers |= blink::WebInputEvent::MetaKey; |
227 #endif | 227 #endif |
228 | |
229 if (flags & EF_ALTGR_DOWN) | 228 if (flags & EF_ALTGR_DOWN) |
230 modifiers |= blink::WebInputEvent::AltGrKey; | 229 modifiers |= blink::WebInputEvent::AltGrKey; |
| 230 if (flags & EF_NUM_LOCK_ON) |
| 231 modifiers |= blink::WebInputEvent::NumLockOn; |
| 232 if (flags & EF_CAPS_LOCK_ON) |
| 233 modifiers |= blink::WebInputEvent::CapsLockOn; |
| 234 if (flags & EF_SCROLL_LOCK_ON) |
| 235 modifiers |= blink::WebInputEvent::ScrollLockOn; |
231 if (flags & EF_LEFT_MOUSE_BUTTON) | 236 if (flags & EF_LEFT_MOUSE_BUTTON) |
232 modifiers |= blink::WebInputEvent::LeftButtonDown; | 237 modifiers |= blink::WebInputEvent::LeftButtonDown; |
233 if (flags & EF_MIDDLE_MOUSE_BUTTON) | 238 if (flags & EF_MIDDLE_MOUSE_BUTTON) |
234 modifiers |= blink::WebInputEvent::MiddleButtonDown; | 239 modifiers |= blink::WebInputEvent::MiddleButtonDown; |
235 if (flags & EF_RIGHT_MOUSE_BUTTON) | 240 if (flags & EF_RIGHT_MOUSE_BUTTON) |
236 modifiers |= blink::WebInputEvent::RightButtonDown; | 241 modifiers |= blink::WebInputEvent::RightButtonDown; |
237 if (flags & EF_CAPS_LOCK_DOWN) | |
238 modifiers |= blink::WebInputEvent::CapsLockOn; | |
239 if (flags & EF_IS_REPEAT) | 242 if (flags & EF_IS_REPEAT) |
240 modifiers |= blink::WebInputEvent::IsAutoRepeat; | 243 modifiers |= blink::WebInputEvent::IsAutoRepeat; |
241 if (flags & ui::EF_TOUCH_ACCESSIBILITY) | 244 if (flags & EF_TOUCH_ACCESSIBILITY) |
242 modifiers |= blink::WebInputEvent::IsTouchAccessibility; | 245 modifiers |= blink::WebInputEvent::IsTouchAccessibility; |
243 if (flags & ui::EF_NUM_LOCK_DOWN) | |
244 modifiers |= blink::WebInputEvent::NumLockOn; | |
245 if (flags & ui::EF_SCROLL_LOCK_DOWN) | |
246 modifiers |= blink::WebInputEvent::ScrollLockOn; | |
247 | 246 |
248 return modifiers; | 247 return modifiers; |
249 } | 248 } |
250 | 249 |
251 WebGestureEvent CreateWebGestureEvent(const GestureEventDetails& details, | 250 WebGestureEvent CreateWebGestureEvent(const GestureEventDetails& details, |
252 base::TimeDelta timestamp, | 251 base::TimeDelta timestamp, |
253 const gfx::PointF& location, | 252 const gfx::PointF& location, |
254 const gfx::PointF& raw_location, | 253 const gfx::PointF& raw_location, |
255 int flags) { | 254 int flags) { |
256 WebGestureEvent gesture; | 255 WebGestureEvent gesture; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 360 } |
362 | 361 |
363 WebGestureEvent CreateWebGestureEventFromGestureEventData( | 362 WebGestureEvent CreateWebGestureEventFromGestureEventData( |
364 const GestureEventData& data) { | 363 const GestureEventData& data) { |
365 return CreateWebGestureEvent(data.details, data.time - base::TimeTicks(), | 364 return CreateWebGestureEvent(data.details, data.time - base::TimeTicks(), |
366 gfx::PointF(data.x, data.y), | 365 gfx::PointF(data.x, data.y), |
367 gfx::PointF(data.raw_x, data.raw_y), data.flags); | 366 gfx::PointF(data.raw_x, data.raw_y), data.flags); |
368 } | 367 } |
369 | 368 |
370 } // namespace ui | 369 } // namespace ui |
OLD | NEW |