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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 switch (tool_type) { | 468 switch (tool_type) { |
469 case MotionEvent::TOOL_TYPE_UNKNOWN: | 469 case MotionEvent::TOOL_TYPE_UNKNOWN: |
470 return WebPointerProperties::PointerType::Unknown; | 470 return WebPointerProperties::PointerType::Unknown; |
471 case MotionEvent::TOOL_TYPE_FINGER: | 471 case MotionEvent::TOOL_TYPE_FINGER: |
472 return WebPointerProperties::PointerType::Touch; | 472 return WebPointerProperties::PointerType::Touch; |
473 case MotionEvent::TOOL_TYPE_STYLUS: | 473 case MotionEvent::TOOL_TYPE_STYLUS: |
474 return WebPointerProperties::PointerType::Pen; | 474 return WebPointerProperties::PointerType::Pen; |
475 case MotionEvent::TOOL_TYPE_MOUSE: | 475 case MotionEvent::TOOL_TYPE_MOUSE: |
476 return WebPointerProperties::PointerType::Mouse; | 476 return WebPointerProperties::PointerType::Mouse; |
477 case MotionEvent::TOOL_TYPE_ERASER: | 477 case MotionEvent::TOOL_TYPE_ERASER: |
478 return WebPointerProperties::PointerType::Unknown; | 478 return WebPointerProperties::PointerType::Eraser; |
479 } | 479 } |
480 NOTREACHED() << "Invalid MotionEvent::ToolType = " << tool_type; | 480 NOTREACHED() << "Invalid MotionEvent::ToolType = " << tool_type; |
481 return WebPointerProperties::PointerType::Unknown; | 481 return WebPointerProperties::PointerType::Unknown; |
482 } | 482 } |
483 | 483 |
484 int WebEventModifiersToEventFlags(int modifiers) { | 484 int WebEventModifiersToEventFlags(int modifiers) { |
485 int flags = 0; | 485 int flags = 0; |
486 | 486 |
487 if (modifiers & blink::WebInputEvent::ShiftKey) | 487 if (modifiers & blink::WebInputEvent::ShiftKey) |
488 flags |= EF_SHIFT_DOWN; | 488 flags |= EF_SHIFT_DOWN; |
(...skipping 29 matching lines...) Expand all Loading... |
518 return blink::WebInputEvent::IsRight; | 518 return blink::WebInputEvent::IsRight; |
519 case DomKeyLocation::NUMPAD: | 519 case DomKeyLocation::NUMPAD: |
520 return blink::WebInputEvent::IsKeyPad; | 520 return blink::WebInputEvent::IsKeyPad; |
521 case DomKeyLocation::STANDARD: | 521 case DomKeyLocation::STANDARD: |
522 break; | 522 break; |
523 } | 523 } |
524 return static_cast<blink::WebInputEvent::Modifiers>(0); | 524 return static_cast<blink::WebInputEvent::Modifiers>(0); |
525 } | 525 } |
526 | 526 |
527 } // namespace ui | 527 } // namespace ui |
OLD | NEW |