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> |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 if (flags & ui::EF_LEFT_MOUSE_BUTTON) | 393 if (flags & ui::EF_LEFT_MOUSE_BUTTON) |
394 modifiers |= blink::WebInputEvent::LeftButtonDown; | 394 modifiers |= blink::WebInputEvent::LeftButtonDown; |
395 if (flags & ui::EF_MIDDLE_MOUSE_BUTTON) | 395 if (flags & ui::EF_MIDDLE_MOUSE_BUTTON) |
396 modifiers |= blink::WebInputEvent::MiddleButtonDown; | 396 modifiers |= blink::WebInputEvent::MiddleButtonDown; |
397 if (flags & ui::EF_RIGHT_MOUSE_BUTTON) | 397 if (flags & ui::EF_RIGHT_MOUSE_BUTTON) |
398 modifiers |= blink::WebInputEvent::RightButtonDown; | 398 modifiers |= blink::WebInputEvent::RightButtonDown; |
399 if (flags & ui::EF_CAPS_LOCK_DOWN) | 399 if (flags & ui::EF_CAPS_LOCK_DOWN) |
400 modifiers |= blink::WebInputEvent::CapsLockOn; | 400 modifiers |= blink::WebInputEvent::CapsLockOn; |
401 if (flags & ui::EF_IS_REPEAT) | 401 if (flags & ui::EF_IS_REPEAT) |
402 modifiers |= blink::WebInputEvent::IsAutoRepeat; | 402 modifiers |= blink::WebInputEvent::IsAutoRepeat; |
403 if (flags & ui::EF_NUMPAD_KEY) | |
404 modifiers |= blink::WebInputEvent::IsKeyPad; | |
jdduke (slow)
2014/09/24 21:03:44
Don't you want a corresponding inverse conversion
Seigo Nonaka
2014/09/25 03:57:47
Yes! Added inverse conversion. Thanks.
On 2014/09
| |
403 | 405 |
404 return modifiers; | 406 return modifiers; |
405 } | 407 } |
406 | 408 |
407 int WebEventModifiersToEventFlags(int modifiers) { | 409 int WebEventModifiersToEventFlags(int modifiers) { |
408 int flags = 0; | 410 int flags = 0; |
409 | 411 |
410 if (modifiers & blink::WebInputEvent::ShiftKey) | 412 if (modifiers & blink::WebInputEvent::ShiftKey) |
411 flags |= ui::EF_SHIFT_DOWN; | 413 flags |= ui::EF_SHIFT_DOWN; |
412 if (modifiers & blink::WebInputEvent::ControlKey) | 414 if (modifiers & blink::WebInputEvent::ControlKey) |
(...skipping 11 matching lines...) Expand all Loading... | |
424 flags |= ui::EF_RIGHT_MOUSE_BUTTON; | 426 flags |= ui::EF_RIGHT_MOUSE_BUTTON; |
425 if (modifiers & blink::WebInputEvent::CapsLockOn) | 427 if (modifiers & blink::WebInputEvent::CapsLockOn) |
426 flags |= ui::EF_CAPS_LOCK_DOWN; | 428 flags |= ui::EF_CAPS_LOCK_DOWN; |
427 if (modifiers & blink::WebInputEvent::IsAutoRepeat) | 429 if (modifiers & blink::WebInputEvent::IsAutoRepeat) |
428 flags |= ui::EF_IS_REPEAT; | 430 flags |= ui::EF_IS_REPEAT; |
429 | 431 |
430 return flags; | 432 return flags; |
431 } | 433 } |
432 | 434 |
433 } // namespace content | 435 } // namespace content |
OLD | NEW |