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 #include "ui/events/gesture_detection/gesture_provider.h" | 5 #include "ui/events/gesture_detection/gesture_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 return GestureEventData(details, | 502 return GestureEventData(details, |
503 motion_event_id, | 503 motion_event_id, |
504 primary_tool_type, | 504 primary_tool_type, |
505 time, | 505 time, |
506 x, | 506 x, |
507 y, | 507 y, |
508 raw_x, | 508 raw_x, |
509 raw_y, | 509 raw_y, |
510 touch_point_count, | 510 touch_point_count, |
511 bounding_box, | 511 bounding_box, |
512 flags); | 512 flags, |
| 513 0U); |
513 } | 514 } |
514 | 515 |
515 GestureEventData CreateGesture(EventType type, | 516 GestureEventData CreateGesture(EventType type, |
516 int motion_event_id, | 517 int motion_event_id, |
517 MotionEvent::ToolType primary_tool_type, | 518 MotionEvent::ToolType primary_tool_type, |
518 base::TimeTicks time, | 519 base::TimeTicks time, |
519 float x, | 520 float x, |
520 float y, | 521 float y, |
521 float raw_x, | 522 float raw_x, |
522 float raw_y, | 523 float raw_y, |
523 size_t touch_point_count, | 524 size_t touch_point_count, |
524 const gfx::RectF& bounding_box, | 525 const gfx::RectF& bounding_box, |
525 int flags) const { | 526 int flags) const { |
526 GestureEventDetails details(type); | 527 GestureEventDetails details(type); |
527 details.set_device_type(GestureDeviceType::DEVICE_TOUCHSCREEN); | 528 details.set_device_type(GestureDeviceType::DEVICE_TOUCHSCREEN); |
528 return GestureEventData(details, motion_event_id, primary_tool_type, time, | 529 return GestureEventData(details, |
529 x, y, raw_x, raw_y, touch_point_count, bounding_box, | 530 motion_event_id, |
530 flags); | 531 primary_tool_type, |
| 532 time, |
| 533 x, |
| 534 y, |
| 535 raw_x, |
| 536 raw_y, |
| 537 touch_point_count, |
| 538 bounding_box, |
| 539 flags, |
| 540 0U); |
531 } | 541 } |
532 | 542 |
533 GestureEventData CreateGesture(const GestureEventDetails& details, | 543 GestureEventData CreateGesture(const GestureEventDetails& details, |
534 const MotionEvent& event) const { | 544 const MotionEvent& event) const { |
535 return GestureEventData(details, | 545 return GestureEventData(details, |
536 event.GetPointerId(), | 546 event.GetPointerId(), |
537 event.GetToolType(), | 547 event.GetToolType(), |
538 event.GetEventTime(), | 548 event.GetEventTime(), |
539 event.GetX(), | 549 event.GetX(), |
540 event.GetY(), | 550 event.GetY(), |
541 event.GetRawX(), | 551 event.GetRawX(), |
542 event.GetRawY(), | 552 event.GetRawY(), |
543 event.GetPointerCount(), | 553 event.GetPointerCount(), |
544 GetBoundingBox(event, details.type()), | 554 GetBoundingBox(event, details.type()), |
545 event.GetFlags()); | 555 event.GetFlags(), |
| 556 0U); |
546 } | 557 } |
547 | 558 |
548 GestureEventData CreateGesture(EventType type, | 559 GestureEventData CreateGesture(EventType type, |
549 const MotionEvent& event) const { | 560 const MotionEvent& event) const { |
550 GestureEventDetails details(type); | 561 GestureEventDetails details(type); |
551 details.set_device_type(GestureDeviceType::DEVICE_TOUCHSCREEN); | 562 details.set_device_type(GestureDeviceType::DEVICE_TOUCHSCREEN); |
552 return CreateGesture(details, event); | 563 return CreateGesture(details, event); |
553 } | 564 } |
554 | 565 |
555 GestureEventData CreateTapGesture(EventType type, | 566 GestureEventData CreateTapGesture(EventType type, |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 // null'ing of the listener until the sequence has ended. | 849 // null'ing of the listener until the sequence has ended. |
839 if (current_down_event_) | 850 if (current_down_event_) |
840 return; | 851 return; |
841 | 852 |
842 const bool double_tap_enabled = | 853 const bool double_tap_enabled = |
843 double_tap_support_for_page_ && double_tap_support_for_platform_; | 854 double_tap_support_for_page_ && double_tap_support_for_platform_; |
844 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 855 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
845 } | 856 } |
846 | 857 |
847 } // namespace ui | 858 } // namespace ui |
OLD | NEW |