Chromium Code Reviews| 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 "components/test_runner/event_sender.h" | 5 #include "components/test_runner/event_sender.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 503 float velocity_x, | 503 float velocity_x, |
| 504 float velocity_y, | 504 float velocity_y, |
| 505 gin::Arguments* args); | 505 gin::Arguments* args); |
| 506 bool IsFlinging() const; | 506 bool IsFlinging() const; |
| 507 void GestureScrollFirstPoint(int x, int y); | 507 void GestureScrollFirstPoint(int x, int y); |
| 508 void TouchStart(); | 508 void TouchStart(); |
| 509 void TouchMove(); | 509 void TouchMove(); |
| 510 void TouchMoveCausingScrollIfUncanceled(); | 510 void TouchMoveCausingScrollIfUncanceled(); |
| 511 void TouchCancel(); | 511 void TouchCancel(); |
| 512 void TouchEnd(); | 512 void TouchEnd(); |
| 513 void NotifyStartOfTouchScroll(); | |
| 514 void NotifyEndOfTouchScroll(); | |
|
tdresser
2016/03/30 19:19:01
This appears to never be defined...
mustaq
2016/03/30 20:21:05
Removed.
| |
| 513 void LeapForward(int milliseconds); | 515 void LeapForward(int milliseconds); |
| 514 double LastEventTimestamp(); | 516 double LastEventTimestamp(); |
| 515 void BeginDragWithFiles(const std::vector<std::string>& files); | 517 void BeginDragWithFiles(const std::vector<std::string>& files); |
| 516 void AddTouchPoint(double x, double y, gin::Arguments* args); | 518 void AddTouchPoint(double x, double y, gin::Arguments* args); |
| 517 void GestureScrollBegin(gin::Arguments* args); | 519 void GestureScrollBegin(gin::Arguments* args); |
| 518 void GestureScrollEnd(gin::Arguments* args); | 520 void GestureScrollEnd(gin::Arguments* args); |
| 519 void GestureScrollUpdate(gin::Arguments* args); | 521 void GestureScrollUpdate(gin::Arguments* args); |
| 520 void GesturePinchBegin(gin::Arguments* args); | 522 void GesturePinchBegin(gin::Arguments* args); |
| 521 void GesturePinchEnd(gin::Arguments* args); | 523 void GesturePinchEnd(gin::Arguments* args); |
| 522 void GesturePinchUpdate(gin::Arguments* args); | 524 void GesturePinchUpdate(gin::Arguments* args); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 624 .SetMethod("setTouchCancelable", &EventSenderBindings::SetTouchCancelable) | 626 .SetMethod("setTouchCancelable", &EventSenderBindings::SetTouchCancelable) |
| 625 .SetMethod("dumpFilenameBeingDragged", | 627 .SetMethod("dumpFilenameBeingDragged", |
| 626 &EventSenderBindings::DumpFilenameBeingDragged) | 628 &EventSenderBindings::DumpFilenameBeingDragged) |
| 627 .SetMethod("gestureFlingCancel", &EventSenderBindings::GestureFlingCancel) | 629 .SetMethod("gestureFlingCancel", &EventSenderBindings::GestureFlingCancel) |
| 628 .SetMethod("gestureFlingStart", &EventSenderBindings::GestureFlingStart) | 630 .SetMethod("gestureFlingStart", &EventSenderBindings::GestureFlingStart) |
| 629 .SetMethod("isFlinging", &EventSenderBindings::IsFlinging) | 631 .SetMethod("isFlinging", &EventSenderBindings::IsFlinging) |
| 630 .SetMethod("gestureScrollFirstPoint", | 632 .SetMethod("gestureScrollFirstPoint", |
| 631 &EventSenderBindings::GestureScrollFirstPoint) | 633 &EventSenderBindings::GestureScrollFirstPoint) |
| 632 .SetMethod("touchStart", &EventSenderBindings::TouchStart) | 634 .SetMethod("touchStart", &EventSenderBindings::TouchStart) |
| 633 .SetMethod("touchMove", &EventSenderBindings::TouchMove) | 635 .SetMethod("touchMove", &EventSenderBindings::TouchMove) |
| 634 .SetMethod("touchMoveCausingScrollIfUncanceled", | |
| 635 &EventSenderBindings::TouchMoveCausingScrollIfUncanceled) | |
| 636 .SetMethod("touchCancel", &EventSenderBindings::TouchCancel) | 636 .SetMethod("touchCancel", &EventSenderBindings::TouchCancel) |
| 637 .SetMethod("touchEnd", &EventSenderBindings::TouchEnd) | 637 .SetMethod("touchEnd", &EventSenderBindings::TouchEnd) |
| 638 .SetMethod("notifyStartOfTouchScroll", | |
| 639 &EventSenderBindings::NotifyStartOfTouchScroll) | |
| 638 .SetMethod("leapForward", &EventSenderBindings::LeapForward) | 640 .SetMethod("leapForward", &EventSenderBindings::LeapForward) |
| 639 .SetMethod("lastEventTimestamp", &EventSenderBindings::LastEventTimestamp) | 641 .SetMethod("lastEventTimestamp", &EventSenderBindings::LastEventTimestamp) |
| 640 .SetMethod("beginDragWithFiles", &EventSenderBindings::BeginDragWithFiles) | 642 .SetMethod("beginDragWithFiles", &EventSenderBindings::BeginDragWithFiles) |
| 641 .SetMethod("addTouchPoint", &EventSenderBindings::AddTouchPoint) | 643 .SetMethod("addTouchPoint", &EventSenderBindings::AddTouchPoint) |
| 642 .SetMethod("gestureScrollBegin", &EventSenderBindings::GestureScrollBegin) | 644 .SetMethod("gestureScrollBegin", &EventSenderBindings::GestureScrollBegin) |
| 643 .SetMethod("gestureScrollEnd", &EventSenderBindings::GestureScrollEnd) | 645 .SetMethod("gestureScrollEnd", &EventSenderBindings::GestureScrollEnd) |
| 644 .SetMethod("gestureScrollUpdate", | 646 .SetMethod("gestureScrollUpdate", |
| 645 &EventSenderBindings::GestureScrollUpdate) | 647 &EventSenderBindings::GestureScrollUpdate) |
| 646 .SetMethod("gesturePinchBegin", &EventSenderBindings::GesturePinchBegin) | 648 .SetMethod("gesturePinchBegin", &EventSenderBindings::GesturePinchBegin) |
| 647 .SetMethod("gesturePinchEnd", &EventSenderBindings::GesturePinchEnd) | 649 .SetMethod("gesturePinchEnd", &EventSenderBindings::GesturePinchEnd) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 808 void EventSenderBindings::TouchStart() { | 810 void EventSenderBindings::TouchStart() { |
| 809 if (sender_) | 811 if (sender_) |
| 810 sender_->TouchStart(); | 812 sender_->TouchStart(); |
| 811 } | 813 } |
| 812 | 814 |
| 813 void EventSenderBindings::TouchMove() { | 815 void EventSenderBindings::TouchMove() { |
| 814 if (sender_) | 816 if (sender_) |
| 815 sender_->TouchMove(); | 817 sender_->TouchMove(); |
| 816 } | 818 } |
| 817 | 819 |
| 818 void EventSenderBindings::TouchMoveCausingScrollIfUncanceled() { | |
| 819 if (sender_) | |
| 820 sender_->TouchMoveCausingScrollIfUncanceled(); | |
| 821 } | |
| 822 | |
| 823 void EventSenderBindings::TouchCancel() { | 820 void EventSenderBindings::TouchCancel() { |
| 824 if (sender_) | 821 if (sender_) |
| 825 sender_->TouchCancel(); | 822 sender_->TouchCancel(); |
| 826 } | 823 } |
| 827 | 824 |
| 828 void EventSenderBindings::TouchEnd() { | 825 void EventSenderBindings::TouchEnd() { |
| 829 if (sender_) | 826 if (sender_) |
| 830 sender_->TouchEnd(); | 827 sender_->TouchEnd(); |
| 831 } | 828 } |
| 832 | 829 |
| 830 void EventSenderBindings::NotifyStartOfTouchScroll() { | |
| 831 if (sender_) | |
| 832 sender_->NotifyStartOfTouchScroll(); | |
| 833 } | |
| 834 | |
| 833 void EventSenderBindings::LeapForward(int milliseconds) { | 835 void EventSenderBindings::LeapForward(int milliseconds) { |
| 834 if (sender_) | 836 if (sender_) |
| 835 sender_->LeapForward(milliseconds); | 837 sender_->LeapForward(milliseconds); |
| 836 } | 838 } |
| 837 | 839 |
| 838 double EventSenderBindings::LastEventTimestamp() { | 840 double EventSenderBindings::LastEventTimestamp() { |
| 839 if (sender_) | 841 if (sender_) |
| 840 return sender_->last_event_timestamp(); | 842 return sender_->last_event_timestamp(); |
| 841 return 0; | 843 return 0; |
| 842 } | 844 } |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1806 } | 1808 } |
| 1807 | 1809 |
| 1808 void EventSender::TouchStart() { | 1810 void EventSender::TouchStart() { |
| 1809 SendCurrentTouchEvent(WebInputEvent::TouchStart, false); | 1811 SendCurrentTouchEvent(WebInputEvent::TouchStart, false); |
| 1810 } | 1812 } |
| 1811 | 1813 |
| 1812 void EventSender::TouchMove() { | 1814 void EventSender::TouchMove() { |
| 1813 SendCurrentTouchEvent(WebInputEvent::TouchMove, false); | 1815 SendCurrentTouchEvent(WebInputEvent::TouchMove, false); |
| 1814 } | 1816 } |
| 1815 | 1817 |
| 1816 void EventSender::TouchMoveCausingScrollIfUncanceled() { | |
| 1817 SendCurrentTouchEvent(WebInputEvent::TouchMove, true); | |
| 1818 } | |
| 1819 | |
| 1820 void EventSender::TouchCancel() { | 1818 void EventSender::TouchCancel() { |
| 1821 SendCurrentTouchEvent(WebInputEvent::TouchCancel, false); | 1819 SendCurrentTouchEvent(WebInputEvent::TouchCancel, false); |
| 1822 } | 1820 } |
| 1823 | 1821 |
| 1824 void EventSender::TouchEnd() { | 1822 void EventSender::TouchEnd() { |
| 1825 SendCurrentTouchEvent(WebInputEvent::TouchEnd, false); | 1823 SendCurrentTouchEvent(WebInputEvent::TouchEnd, false); |
| 1826 } | 1824 } |
| 1827 | 1825 |
| 1826 void EventSender::NotifyStartOfTouchScroll() { | |
| 1827 WebTouchEvent event; | |
| 1828 event.type = WebInputEvent::TouchScrollStarted; | |
| 1829 HandleInputEventOnViewOrPopup(event); | |
| 1830 } | |
| 1831 | |
| 1828 void EventSender::LeapForward(int milliseconds) { | 1832 void EventSender::LeapForward(int milliseconds) { |
| 1829 if (is_drag_mode_ && pressed_button_ == WebMouseEvent::ButtonLeft && | 1833 if (is_drag_mode_ && pressed_button_ == WebMouseEvent::ButtonLeft && |
| 1830 !replaying_saved_events_) { | 1834 !replaying_saved_events_) { |
| 1831 SavedEvent saved_event; | 1835 SavedEvent saved_event; |
| 1832 saved_event.type = SavedEvent::TYPE_LEAP_FORWARD; | 1836 saved_event.type = SavedEvent::TYPE_LEAP_FORWARD; |
| 1833 saved_event.milliseconds = milliseconds; | 1837 saved_event.milliseconds = milliseconds; |
| 1834 mouse_event_queue_.push_back(saved_event); | 1838 mouse_event_queue_.push_back(saved_event); |
| 1835 } else { | 1839 } else { |
| 1836 DoLeapForward(milliseconds); | 1840 DoLeapForward(milliseconds); |
| 1837 } | 1841 } |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2655 &end_event); | 2659 &end_event); |
| 2656 end_event.data.scrollEnd.deltaUnits = | 2660 end_event.data.scrollEnd.deltaUnits = |
| 2657 begin_event.data.scrollBegin.deltaHintUnits; | 2661 begin_event.data.scrollBegin.deltaHintUnits; |
| 2658 | 2662 |
| 2659 if (force_layout_on_events_) | 2663 if (force_layout_on_events_) |
| 2660 view_->updateAllLifecyclePhases(); | 2664 view_->updateAllLifecyclePhases(); |
| 2661 HandleInputEventOnViewOrPopup(end_event); | 2665 HandleInputEventOnViewOrPopup(end_event); |
| 2662 } | 2666 } |
| 2663 | 2667 |
| 2664 } // namespace test_runner | 2668 } // namespace test_runner |
| OLD | NEW |