diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 22:28:04 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 22:28:04 +0000 |
commit | 8ca8d24697eb99d14cab7028ad3b7c152dde7d56 (patch) | |
tree | 52ed61ac468fe094769ef78b3813af0fd51ab5bd | |
parent | 2a848e0e4d75cd9195d15ff955014397482f9faa (diff) | |
download | chromium_src-8ca8d24697eb99d14cab7028ad3b7c152dde7d56.zip chromium_src-8ca8d24697eb99d14cab7028ad3b7c152dde7d56.tar.gz chromium_src-8ca8d24697eb99d14cab7028ad3b7c152dde7d56.tar.bz2 |
Remove TouchEvent interface, and rename TouchEventImpl to TouchEvent.
BUG=125937
Review URL: https://chromiumcodereview.appspot.com/10831240
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150918 0039d316-1c4b-4281-b951-d872f2087c98
84 files changed, 362 insertions, 461 deletions
diff --git a/ash/accelerators/accelerator_filter.cc b/ash/accelerators/accelerator_filter.cc index ffb2c78..652ed6d 100644 --- a/ash/accelerators/accelerator_filter.cc +++ b/ash/accelerators/accelerator_filter.cc @@ -85,7 +85,7 @@ bool AcceleratorFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus AcceleratorFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/accelerators/accelerator_filter.h b/ash/accelerators/accelerator_filter.h index 6d5855d..2d2e5f9 100644 --- a/ash/accelerators/accelerator_filter.h +++ b/ash/accelerators/accelerator_filter.h @@ -27,7 +27,7 @@ class ASH_EXPORT AcceleratorFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc index 217fc3a..474119e 100644 --- a/ash/display/mouse_cursor_event_filter.cc +++ b/ash/display/mouse_cursor_event_filter.cc @@ -48,7 +48,7 @@ bool MouseCursorEventFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus MouseCursorEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/display/mouse_cursor_event_filter.h b/ash/display/mouse_cursor_event_filter.h index 3d95843..34df074 100644 --- a/ash/display/mouse_cursor_event_filter.h +++ b/ash/display/mouse_cursor_event_filter.h @@ -27,7 +27,7 @@ class ASH_EXPORT MouseCursorEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index 5657cf2..cd99aeb 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -232,7 +232,7 @@ bool DragDropController::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus DragDropController::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { // TODO(sad): Also check for the touch-id. if (!drag_drop_in_progress_) return ui::TOUCH_STATUS_UNKNOWN; diff --git a/ash/drag_drop/drag_drop_controller.h b/ash/drag_drop/drag_drop_controller.h index f3f0985..e806265 100644 --- a/ash/drag_drop/drag_drop_controller.h +++ b/ash/drag_drop/drag_drop_controller.h @@ -65,7 +65,7 @@ class ASH_EXPORT DragDropController ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/launcher/launcher_tooltip_manager.cc b/ash/launcher/launcher_tooltip_manager.cc index 51b56d0..04f7fbc 100644 --- a/ash/launcher/launcher_tooltip_manager.cc +++ b/ash/launcher/launcher_tooltip_manager.cc @@ -332,7 +332,7 @@ bool LauncherTooltipManager::PreHandleMouseEvent(aura::Window* target, } ui::TouchStatus LauncherTooltipManager::PreHandleTouchEvent( - aura::Window* target, ui::TouchEventImpl* event) { + aura::Window* target, ui::TouchEvent* event) { if (widget_ && widget_->IsVisible() && widget_->GetNativeWindow() != target) Close(); return ui::TOUCH_STATUS_UNKNOWN; diff --git a/ash/launcher/launcher_tooltip_manager.h b/ash/launcher/launcher_tooltip_manager.h index 95c9fcf..ed13731 100644 --- a/ash/launcher/launcher_tooltip_manager.h +++ b/ash/launcher/launcher_tooltip_manager.h @@ -77,7 +77,7 @@ protected: ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/launcher/launcher_tooltip_manager_unittest.cc b/ash/launcher/launcher_tooltip_manager_unittest.cc index 391d948..527b4cd 100644 --- a/ash/launcher/launcher_tooltip_manager_unittest.cc +++ b/ash/launcher/launcher_tooltip_manager_unittest.cc @@ -146,7 +146,7 @@ TEST_F(LauncherTooltipManagerTest, ShouldHideForEvents) { EXPECT_TRUE(TooltipIsVisible()); // Should hide for touch events. - ui::TouchEventImpl touch_event( + ui::TouchEvent touch_event( ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN, event_filter->PreHandleTouchEvent(root_window, &touch_event)); diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index 22785d3..4a84ef4 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -104,7 +104,7 @@ class MagnificationControllerImpl : virtual public MagnificationController, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; @@ -448,7 +448,7 @@ bool MagnificationControllerImpl::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus MagnificationControllerImpl::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/system/tray/tray_bubble_view.cc b/ash/system/tray/tray_bubble_view.cc index 7a6fa10..93b6c7e 100644 --- a/ash/system/tray/tray_bubble_view.cc +++ b/ash/system/tray/tray_bubble_view.cc @@ -469,7 +469,7 @@ bool TrayBubbleView::Host::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus TrayBubbleView::Host::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { if (event->type() == ui::ET_TOUCH_PRESSED) ProcessLocatedEvent(*event); return ui::TOUCH_STATUS_UNKNOWN; diff --git a/ash/system/tray/tray_bubble_view.h b/ash/system/tray/tray_bubble_view.h index 5a10f9c..93489ed 100644 --- a/ash/system/tray/tray_bubble_view.h +++ b/ash/system/tray/tray_bubble_view.h @@ -53,7 +53,7 @@ class TrayBubbleView : public views::BubbleDelegateView { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc index a73f119..1be88a9 100644 --- a/ash/tooltips/tooltip_controller.cc +++ b/ash/tooltips/tooltip_controller.cc @@ -295,7 +295,7 @@ bool TooltipController::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus TooltipController::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { // TODO(varunjain): need to properly implement tooltips for // touch events. // Hide the tooltip for touch events. diff --git a/ash/tooltips/tooltip_controller.h b/ash/tooltips/tooltip_controller.h index e623701..0c1190b 100644 --- a/ash/tooltips/tooltip_controller.h +++ b/ash/tooltips/tooltip_controller.h @@ -48,7 +48,7 @@ class ASH_EXPORT TooltipController : public aura::client::TooltipClient, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent(aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/touch/touch_observer_hud.cc b/ash/touch/touch_observer_hud.cc index 31d3910..65b75bd 100644 --- a/ash/touch/touch_observer_hud.cc +++ b/ash/touch/touch_observer_hud.cc @@ -194,7 +194,7 @@ bool TouchObserverHUD::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus TouchObserverHUD::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { if (event->touch_id() >= kMaxTouchPoints) return ui::TOUCH_STATUS_UNKNOWN; diff --git a/ash/touch/touch_observer_hud.h b/ash/touch/touch_observer_hud.h index cdb2493..c3d56fe 100644 --- a/ash/touch/touch_observer_hud.h +++ b/ash/touch/touch_observer_hud.h @@ -41,7 +41,7 @@ class TouchObserverHUD : public aura::EventFilter, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/touch/touch_uma.cc b/ash/touch/touch_uma.cc index 3acd93d..ca2a826 100644 --- a/ash/touch/touch_uma.cc +++ b/ash/touch/touch_uma.cc @@ -256,7 +256,7 @@ void TouchUMA::RecordGestureEvent(aura::Window* target, } void TouchUMA::RecordTouchEvent(aura::Window* target, - const ui::TouchEventImpl& event) { + const ui::TouchEvent& event) { UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchRadius", static_cast<int>(std::max(event.radius_x(), event.radius_y())), 1, 500, 100); diff --git a/ash/touch/touch_uma.h b/ash/touch/touch_uma.h index 72daed9..457fdd1 100644 --- a/ash/touch/touch_uma.h +++ b/ash/touch/touch_uma.h @@ -29,7 +29,7 @@ class TouchUMA { void RecordGestureEvent(aura::Window* target, const ui::GestureEventImpl& event); void RecordTouchEvent(aura::Window* target, - const ui::TouchEventImpl& event); + const ui::TouchEvent& event); private: DISALLOW_COPY_AND_ASSIGN(TouchUMA); diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc index 19eb91f..4a15e92 100644 --- a/ash/wm/app_list_controller.cc +++ b/ash/wm/app_list_controller.cc @@ -247,7 +247,7 @@ bool AppListController::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus AppListController::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/wm/app_list_controller.h b/ash/wm/app_list_controller.h index 32fdb6a..6e67b0b 100644 --- a/ash/wm/app_list_controller.h +++ b/ash/wm/app_list_controller.h @@ -80,7 +80,7 @@ class AppListController : public aura::EventFilter, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/event_rewriter_event_filter.cc b/ash/wm/event_rewriter_event_filter.cc index acab56c..83a9aef 100644 --- a/ash/wm/event_rewriter_event_filter.cc +++ b/ash/wm/event_rewriter_event_filter.cc @@ -59,7 +59,7 @@ bool EventRewriterEventFilter::PreHandleMouseEvent( } ui::TouchStatus EventRewriterEventFilter::PreHandleTouchEvent( - aura::Window* target, ui::TouchEventImpl* event) { + aura::Window* target, ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; // Not handled. } diff --git a/ash/wm/event_rewriter_event_filter.h b/ash/wm/event_rewriter_event_filter.h index 51f5a9c..5a633a5 100644 --- a/ash/wm/event_rewriter_event_filter.h +++ b/ash/wm/event_rewriter_event_filter.h @@ -33,7 +33,7 @@ class ASH_EXPORT EventRewriterEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/overlay_event_filter.cc b/ash/wm/overlay_event_filter.cc index f977f3e..a3b2395 100644 --- a/ash/wm/overlay_event_filter.cc +++ b/ash/wm/overlay_event_filter.cc @@ -59,7 +59,7 @@ bool OverlayEventFilter::PreHandleMouseEvent( } ui::TouchStatus OverlayEventFilter::PreHandleTouchEvent( - aura::Window* target, ui::TouchEventImpl* event) { + aura::Window* target, ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; // Not handled. } diff --git a/ash/wm/overlay_event_filter.h b/ash/wm/overlay_event_filter.h index ed1456c..49d0250 100644 --- a/ash/wm/overlay_event_filter.h +++ b/ash/wm/overlay_event_filter.h @@ -55,7 +55,7 @@ class OverlayEventFilter : public aura::EventFilter, virtual bool PreHandleMouseEvent( aura::Window* target, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( - aura::Window* target, ui::TouchEventImpl* event) OVERRIDE; + aura::Window* target, ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/panel_window_event_filter.cc b/ash/wm/panel_window_event_filter.cc index 461ced0..bab183f 100644 --- a/ash/wm/panel_window_event_filter.cc +++ b/ash/wm/panel_window_event_filter.cc @@ -97,7 +97,7 @@ bool PanelWindowEventFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus PanelWindowEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/wm/panel_window_event_filter.h b/ash/wm/panel_window_event_filter.h index ba40003..db2fb12 100644 --- a/ash/wm/panel_window_event_filter.h +++ b/ash/wm/panel_window_event_filter.h @@ -34,7 +34,7 @@ class PanelWindowEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc index e1da66e..a2b847e 100644 --- a/ash/wm/shelf_layout_manager.cc +++ b/ash/wm/shelf_layout_manager.cc @@ -64,7 +64,7 @@ class ShelfLayoutManager::AutoHideEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; @@ -109,7 +109,7 @@ bool ShelfLayoutManager::AutoHideEventFilter::PreHandleMouseEvent( ui::TouchStatus ShelfLayoutManager::AutoHideEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; // Not handled. } diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc index 6bb5d8a..e909acb 100644 --- a/ash/wm/system_gesture_event_filter.cc +++ b/ash/wm/system_gesture_event_filter.cc @@ -544,7 +544,7 @@ bool SystemGestureEventFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus SystemGestureEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { touch_uma_.RecordTouchEvent(target, *event); long_press_affordance_->ProcessEvent(target, event); return ui::TOUCH_STATUS_UNKNOWN; diff --git a/ash/wm/system_gesture_event_filter.h b/ash/wm/system_gesture_event_filter.h index 466ec04..9585481 100644 --- a/ash/wm/system_gesture_event_filter.h +++ b/ash/wm/system_gesture_event_filter.h @@ -98,7 +98,7 @@ class SystemGestureEventFilter : public aura::EventFilter, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc index ed83863..638f2d9 100644 --- a/ash/wm/system_gesture_event_filter_unittest.cc +++ b/ash/wm/system_gesture_event_filter_unittest.cc @@ -158,7 +158,7 @@ TEST_F(SystemGestureEventFilterTest, TapOutsideRootWindow) { const int kTouchId = 5; // A touch outside the root window will be associated with the root window - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(-10, -10), kTouchId, + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(-10, -10), kTouchId, base::Time::NowFromSystemTime() - base::Time()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); @@ -214,7 +214,7 @@ TEST_F(SystemGestureEventFilterTest, DeviceControl) { xpos = screen.right() + 40; // Make sure it is out of the screen. } // Get a target for kTouchId - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(-10, ypos + ypos_half), kTouchId, base::Time::NowFromSystemTime() - base::Time()); @@ -284,7 +284,7 @@ TEST_F(SystemGestureEventFilterTest, DeviceControl) { EXPECT_TRUE(consumed); EXPECT_EQ(3, delegate->handle_percent_count()); - ui::TouchEventImpl release1( + ui::TouchEvent release1( ui::ET_TOUCH_RELEASED, gfx::Point(2 * xpos, ypos + ypos_half), kTouchId, base::Time::NowFromSystemTime() - base::Time()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); @@ -330,7 +330,7 @@ TEST_F(SystemGestureEventFilterTest, ApplicationControl) { aura::Window* active_window = ash::wm::GetActiveWindow(); // Get a target for kTouchId - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(-10, ypos + ypos_half), kTouchId, base::Time::NowFromSystemTime() - base::Time()); @@ -381,7 +381,7 @@ TEST_F(SystemGestureEventFilterTest, ApplicationControl) { EXPECT_TRUE(consumed); EXPECT_EQ(ash::wm::GetActiveWindow(), active_window); - ui::TouchEventImpl release( + ui::TouchEvent release( ui::ET_TOUCH_RELEASED, gfx::Point(2 * xpos, ypos + ypos_half), kTouchId, base::Time::NowFromSystemTime() - base::Time()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -413,7 +413,7 @@ TEST_F(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) { EXPECT_TRUE(window1->HasCapture()); // Send touch event to first window. - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId, + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId, base::Time::NowFromSystemTime() - base::Time()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_TRUE(window1->HasCapture()); diff --git a/ash/wm/system_modal_container_event_filter.cc b/ash/wm/system_modal_container_event_filter.cc index 448a73c..eb835b7 100644 --- a/ash/wm/system_modal_container_event_filter.cc +++ b/ash/wm/system_modal_container_event_filter.cc @@ -32,7 +32,7 @@ bool SystemModalContainerEventFilter::PreHandleMouseEvent( ui::TouchStatus SystemModalContainerEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { // TODO(sadrul): ! return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/wm/system_modal_container_event_filter.h b/ash/wm/system_modal_container_event_filter.h index ce45d7e..cded403 100644 --- a/ash/wm/system_modal_container_event_filter.h +++ b/ash/wm/system_modal_container_event_filter.h @@ -27,7 +27,7 @@ class ASH_EXPORT SystemModalContainerEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/toplevel_window_event_filter.cc b/ash/wm/toplevel_window_event_filter.cc index e896d07..3a6abd7 100644 --- a/ash/wm/toplevel_window_event_filter.cc +++ b/ash/wm/toplevel_window_event_filter.cc @@ -120,7 +120,7 @@ bool ToplevelWindowEventFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus ToplevelWindowEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/wm/toplevel_window_event_filter.h b/ash/wm/toplevel_window_event_filter.h index 02deebb..fc4fa578 100644 --- a/ash/wm/toplevel_window_event_filter.h +++ b/ash/wm/toplevel_window_event_filter.h @@ -48,7 +48,7 @@ class ASH_EXPORT ToplevelWindowEventFilter : ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/user_activity_detector.cc b/ash/wm/user_activity_detector.cc index 5f16b6f..c2c5d1a 100644 --- a/ash/wm/user_activity_detector.cc +++ b/ash/wm/user_activity_detector.cc @@ -49,7 +49,7 @@ bool UserActivityDetector::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus UserActivityDetector::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { if (!GetRootWindowController(target->GetRootWindow())) return ui::TOUCH_STATUS_END; MaybeNotify(); diff --git a/ash/wm/user_activity_detector.h b/ash/wm/user_activity_detector.h index 2332ffd..51f1d11 100644 --- a/ash/wm/user_activity_detector.h +++ b/ash/wm/user_activity_detector.h @@ -40,7 +40,7 @@ class ASH_EXPORT UserActivityDetector : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/user_activity_detector_unittest.cc b/ash/wm/user_activity_detector_unittest.cc index f396a52..cdf94f1 100644 --- a/ash/wm/user_activity_detector_unittest.cc +++ b/ash/wm/user_activity_detector_unittest.cc @@ -97,7 +97,7 @@ TEST_F(UserActivityDetectorTest, Basic) { observer_->reset_stats(); AdvanceTime(advance_delta); - ui::TouchEventImpl touch_event( + ui::TouchEvent touch_event( ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); EXPECT_FALSE(detector_->PreHandleTouchEvent(window.get(), &touch_event)); EXPECT_EQ(1, observer_->num_invocations()); diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc index dd71538..31fea4e 100644 --- a/ash/wm/window_cycle_controller.cc +++ b/ash/wm/window_cycle_controller.cc @@ -39,7 +39,7 @@ class WindowCycleEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; @@ -74,7 +74,7 @@ bool WindowCycleEventFilter::PreHandleMouseEvent( ui::TouchStatus WindowCycleEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; // Not handled. } diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index cb558b6..fd67cfd 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -123,7 +123,7 @@ TEST_F(WindowManagerTest, Focus) { // Touch on a sub-window (w122) to focus it. gfx::Point click_point = w122->bounds().CenterPoint(); aura::Window::ConvertPointToTarget(w122->parent(), root_window, &click_point); - ui::TouchEventImpl touchev(ui::ET_TOUCH_PRESSED, click_point, 0, getTime()); + ui::TouchEvent touchev(ui::ET_TOUCH_PRESSED, click_point, 0, getTime()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev); focus_manager = w122->GetFocusManager(); EXPECT_EQ(w122.get(), focus_manager->GetFocusedWindow()); @@ -323,7 +323,7 @@ TEST_F(WindowManagerTest, ActivateOnTouch) { // Touch window2. gfx::Point press_point = w2->bounds().CenterPoint(); aura::Window::ConvertPointToTarget(w2->parent(), root_window, &press_point); - ui::TouchEventImpl touchev1(ui::ET_TOUCH_PRESSED, press_point, 0, getTime()); + ui::TouchEvent touchev1(ui::ET_TOUCH_PRESSED, press_point, 0, getTime()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev1); // Window2 should have become active. @@ -340,7 +340,7 @@ TEST_F(WindowManagerTest, ActivateOnTouch) { press_point = w1->bounds().CenterPoint(); aura::Window::ConvertPointToTarget(w1->parent(), root_window, &press_point); d1.set_activate(false); - ui::TouchEventImpl touchev2(ui::ET_TOUCH_PRESSED, press_point, 1, getTime()); + ui::TouchEvent touchev2(ui::ET_TOUCH_PRESSED, press_point, 1, getTime()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev2); // Window2 should still be active and focused. @@ -579,9 +579,9 @@ TEST_F(WindowManagerTest, UpdateCursorVisibility) { ui::MouseEvent mouse_moved( ui::ET_MOUSE_MOVED, gfx::Point(0, 0), gfx::Point(0, 0), 0x0); - ui::TouchEventImpl touch_pressed1( + ui::TouchEvent touch_pressed1( ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, getTime()); - ui::TouchEventImpl touch_pressed2( + ui::TouchEvent touch_pressed2( ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 1, getTime()); env_filter->set_update_cursor_visibility(true); diff --git a/ash/wm/window_modality_controller.cc b/ash/wm/window_modality_controller.cc index bf474d8..1c72edf 100644 --- a/ash/wm/window_modality_controller.cc +++ b/ash/wm/window_modality_controller.cc @@ -86,7 +86,7 @@ bool WindowModalityController::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus WindowModalityController::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ProcessLocatedEvent(target, event) ? ui::TOUCH_STATUS_CONTINUE : ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ash/wm/window_modality_controller.h b/ash/wm/window_modality_controller.h index 614eb92..05ac6bb 100644 --- a/ash/wm/window_modality_controller.h +++ b/ash/wm/window_modality_controller.h @@ -44,7 +44,7 @@ class WindowModalityController : public aura::EventFilter, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ash/wm/window_modality_controller_unittest.cc b/ash/wm/window_modality_controller_unittest.cc index d5a40fa..d749bd6 100644 --- a/ash/wm/window_modality_controller_unittest.cc +++ b/ash/wm/window_modality_controller_unittest.cc @@ -294,7 +294,7 @@ class TouchTrackerWindowDelegate : public aura::test::TestWindowDelegate { private: // Overridden from aura::test::TestWindowDelegate. - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE { + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { received_touch_ = true; return aura::test::TestWindowDelegate::OnTouchEvent(event); } diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc index ba2281b..33cdbf1 100644 --- a/ash/wm/workspace/frame_maximize_button.cc +++ b/ash/wm/workspace/frame_maximize_button.cc @@ -49,7 +49,7 @@ class FrameMaximizeButton::EscapeEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; @@ -88,7 +88,7 @@ bool FrameMaximizeButton::EscapeEventFilter::PreHandleMouseEvent( ui::TouchStatus FrameMaximizeButton::EscapeEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index f60623a..b02fdad 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -1276,7 +1276,7 @@ bool RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { } ui::TouchStatus RenderWidgetHostViewAura::OnTouchEvent( - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnTouchEvent"); // Update the touch event first. WebKit::WebTouchPoint* point = UpdateWebTouchEvent(event, diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index e8c4711..4913a89 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -166,7 +166,7 @@ class RenderWidgetHostViewAura aura::Window* child, const gfx::Point& location) OVERRIDE; virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE; - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE; + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus OnGestureEvent( ui::GestureEventImpl* event) OVERRIDE; virtual bool CanFocus() OVERRIDE; diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index 56dfab5..237a320 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -457,14 +457,14 @@ class LocalGestureEvent : DISALLOW_COPY_AND_ASSIGN(LocalGestureEvent); }; -class TouchEventFromWebTouchPoint : public ui::TouchEventImpl { +class TouchEventFromWebTouchPoint : public ui::TouchEvent { public: TouchEventFromWebTouchPoint(const WebKit::WebTouchPoint& touch_point, base::TimeDelta& timestamp) - : ui::TouchEventImpl(ConvertToUIEvent(touch_point.state), - touch_point.position, - touch_point.id, - timestamp) { + : ui::TouchEvent(ConvertToUIEvent(touch_point.state), + touch_point.position, + touch_point.id, + timestamp) { set_radius(touch_point.radiusX, touch_point.radiusY); set_rotation_angle(touch_point.rotationAngle); set_force(touch_point.force); @@ -1259,7 +1259,7 @@ ui::TouchEvent* RenderWidgetHostViewWin::CreateTouchEvent( const gfx::Point& location, int touch_id, base::TimeDelta time_stamp) { - return new ui::TouchEventImpl(type, location, touch_id, time_stamp); + return new ui::TouchEvent(type, location, touch_id, time_stamp); } bool RenderWidgetHostViewWin::DispatchLongPressGestureEvent( @@ -1271,10 +1271,10 @@ bool RenderWidgetHostViewWin::DispatchCancelTouchEvent( ui::TouchEvent* event) { if (!render_widget_host_ || !touch_events_enabled_) return false; - DCHECK(event->GetEventType() == WebKit::WebInputEvent::TouchCancel); + DCHECK(event->type() == WebKit::WebInputEvent::TouchCancel); WebKit::WebTouchEvent cancel_event; cancel_event.type = WebKit::WebInputEvent::TouchCancel; - cancel_event.timeStampSeconds = event->GetTimestamp().InSecondsF(); + cancel_event.timeStampSeconds = event->time_stamp().InSecondsF(); render_widget_host_->ForwardTouchEvent(cancel_event); return true; } diff --git a/content/browser/renderer_host/web_input_event_aura.cc b/content/browser/renderer_host/web_input_event_aura.cc index 7054d91..3395c47 100644 --- a/content/browser/renderer_host/web_input_event_aura.cc +++ b/content/browser/renderer_host/web_input_event_aura.cc @@ -33,7 +33,7 @@ WebKit::WebGestureEvent MakeWebGestureEventFromAuraEvent( WebKit::WebGestureEvent MakeWebGestureEventFromAuraEvent( ui::ScrollEvent* event); WebKit::WebTouchPoint* UpdateWebTouchEventFromAuraEvent( - ui::TouchEventImpl* event, WebKit::WebTouchEvent* web_event); + ui::TouchEvent* event, WebKit::WebTouchEvent* web_event); #endif // General approach: @@ -184,7 +184,7 @@ WebKit::WebGestureEvent MakeWebGestureEventFlingCancel() { return gesture_event; } -WebKit::WebTouchPoint* UpdateWebTouchEvent(ui::TouchEventImpl* event, +WebKit::WebTouchPoint* UpdateWebTouchEvent(ui::TouchEvent* event, WebKit::WebTouchEvent* web_event) { #if defined(OS_WIN) return UpdateWebTouchEventFromNativeEvent(event->native_event(), web_event); diff --git a/content/browser/renderer_host/web_input_event_aura.h b/content/browser/renderer_host/web_input_event_aura.h index c26a31e..231a580 100644 --- a/content/browser/renderer_host/web_input_event_aura.h +++ b/content/browser/renderer_host/web_input_event_aura.h @@ -13,7 +13,7 @@ class GestureEventImpl; class KeyEvent; class MouseEvent; class ScrollEvent; -class TouchEventImpl; +class TouchEvent; } namespace content { @@ -35,7 +35,7 @@ CONTENT_EXPORT WebKit::WebGestureEvent MakeWebGestureEventFlingCancel(); // Updates the WebTouchEvent based on the TouchEvent. It returns the updated // WebTouchPoint contained in the WebTouchEvent, or NULL if no point was // updated. -WebKit::WebTouchPoint* UpdateWebTouchEvent(ui::TouchEventImpl* event, +WebKit::WebTouchPoint* UpdateWebTouchEvent(ui::TouchEvent* event, WebKit::WebTouchEvent* web_event); } diff --git a/content/browser/renderer_host/web_input_event_aurax11.cc b/content/browser/renderer_host/web_input_event_aurax11.cc index 0235bb0..934df1d 100644 --- a/content/browser/renderer_host/web_input_event_aurax11.cc +++ b/content/browser/renderer_host/web_input_event_aurax11.cc @@ -182,7 +182,7 @@ WebKit::WebUChar GetControlCharacter(int windows_key_code, bool shift) { } WebKit::WebTouchPoint::State TouchPointStateFromEvent( - const ui::TouchEventImpl* event) { + const ui::TouchEvent* event) { switch (event->type()) { case ui::ET_TOUCH_PRESSED: return WebKit::WebTouchPoint::StatePressed; @@ -198,7 +198,7 @@ WebKit::WebTouchPoint::State TouchPointStateFromEvent( } WebKit::WebInputEvent::Type TouchEventTypeFromEvent( - const ui::TouchEventImpl* event) { + const ui::TouchEvent* event) { switch (event->type()) { case ui::ET_TOUCH_PRESSED: return WebKit::WebInputEvent::TouchStart; @@ -422,7 +422,7 @@ WebKit::WebGestureEvent MakeWebGestureEventFromAuraEvent( } WebKit::WebTouchPoint* UpdateWebTouchEventFromAuraEvent( - ui::TouchEventImpl* event, WebKit::WebTouchEvent* web_event) { + ui::TouchEvent* event, WebKit::WebTouchEvent* web_event) { WebKit::WebTouchPoint* point = NULL; switch (event->type()) { case ui::ET_TOUCH_PRESSED: diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 2ea648f..6b382ec 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -532,7 +532,7 @@ bool WebContentsViewAura::OnMouseEvent(ui::MouseEvent* event) { return false; } -ui::TouchStatus WebContentsViewAura::OnTouchEvent(ui::TouchEventImpl* event) { +ui::TouchStatus WebContentsViewAura::OnTouchEvent(ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h index 1db8a96..a2377c1 100644 --- a/content/browser/web_contents/web_contents_view_aura.h +++ b/content/browser/web_contents/web_contents_view_aura.h @@ -101,7 +101,7 @@ class CONTENT_EXPORT WebContentsViewAura aura::Window* child, const gfx::Point& location) OVERRIDE; virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE; - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE; + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus OnGestureEvent( ui::GestureEventImpl* event) OVERRIDE; virtual bool CanFocus() OVERRIDE; diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc index 52e5fc2..48b50d2 100644 --- a/ui/aura/demo/demo_main.cc +++ b/ui/aura/demo/demo_main.cc @@ -59,7 +59,7 @@ class DemoWindowDelegate : public aura::WindowDelegate { virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE { return true; } - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE { + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { return ui::TOUCH_STATUS_END; } virtual ui::GestureStatus OnGestureEvent( diff --git a/ui/aura/event_filter.h b/ui/aura/event_filter.h index e103964..a4e6ecd 100644 --- a/ui/aura/event_filter.h +++ b/ui/aura/event_filter.h @@ -13,7 +13,7 @@ namespace ui { class GestureEventImpl; class KeyEvent; class MouseEvent; -class TouchEventImpl; +class TouchEvent; } namespace aura { @@ -53,7 +53,7 @@ class AURA_EXPORT EventFilter { // Returns a value other than ui::TOUCH_STATUS_UNKNOWN if the event is // consumed. virtual ui::TouchStatus PreHandleTouchEvent(Window* target, - ui::TouchEventImpl* event) = 0; + ui::TouchEvent* event) = 0; // Returns a value other than ui::GESTURE_STATUS_UNKNOWN if the gesture is // consumed. diff --git a/ui/aura/event_filter_unittest.cc b/ui/aura/event_filter_unittest.cc index cdc0308..6bf4703 100644 --- a/ui/aura/event_filter_unittest.cc +++ b/ui/aura/event_filter_unittest.cc @@ -53,7 +53,7 @@ class TestEventFilterWindowDelegate : public TestWindowDelegate { ++mouse_event_count_; return true; } - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE { + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { ++touch_event_count_; return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index 4391fe7..e3403e0 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -216,7 +216,7 @@ class QueueTouchEventDelegate : public GestureEventConsumeDelegate { } virtual ~QueueTouchEventDelegate() {} - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE { + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { return event->type() == ui::ET_TOUCH_RELEASED ? ui::TOUCH_STATUS_QUEUED_END : ui::TOUCH_STATUS_QUEUED; } @@ -378,7 +378,7 @@ void SendScrollEvents(RootWindow* root_window, x += dx; y += dy; time = time + base::TimeDelta::FromMilliseconds(time_step); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), touch_id, time); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); } @@ -390,7 +390,7 @@ void SendScrollEvent(RootWindow* root_window, int touch_id, GestureEventConsumeDelegate* delegate) { delegate->Reset(); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), touch_id, GetTime()); root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); } @@ -411,7 +411,7 @@ TEST_F(GestureRecognizerTest, GestureEventTap) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); @@ -426,7 +426,7 @@ TEST_F(GestureRecognizerTest, GestureEventTap) { // Make sure there is enough delay before the touch is released so that it is // recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -458,7 +458,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { // Test with no ET_TOUCH_MOVED events. { delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); press.set_radius_x(5); press.set_radius_y(12); @@ -475,7 +475,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { // Make sure there is enough delay before the touch is released so that it // is recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); release.set_radius_x(5); @@ -502,7 +502,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { // Test with no ET_TOUCH_MOVED events but different touch points and radii. { delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(365, 290), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(365, 290), kTouchId, GetTime()); press.set_radius_x(8); press.set_radius_y(14); @@ -517,7 +517,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(377, 291), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(377, 291), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); release.set_radius_x(20); @@ -544,7 +544,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { // Test with a single ET_TOUCH_MOVED event. { delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(46, 205), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(46, 205), kTouchId, GetTime()); press.set_radius_x(6); press.set_radius_y(10); @@ -559,7 +559,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(52, 200), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(52, 200), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); move.set_radius_x(8); @@ -575,7 +575,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(50, 195), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(50, 195), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); release.set_radius_x(4); @@ -602,7 +602,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { // Test with a few ET_TOUCH_MOVED events. { delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(400, 150), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(400, 150), kTouchId, GetTime()); press.set_radius_x(7); press.set_radius_y(10); @@ -617,7 +617,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(397, 155), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(397, 155), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); move.set_radius_x(13); @@ -633,7 +633,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(395, 148), + ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(395, 148), kTouchId, move.time_stamp() + base::TimeDelta::FromMilliseconds(50)); move1.set_radius_x(16); @@ -649,7 +649,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(400, 150), + ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(400, 150), kTouchId, move1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); move2.set_radius_x(14); @@ -665,7 +665,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(401, 149), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(401, 149), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); release.set_radius_x(8); @@ -702,7 +702,7 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); @@ -761,7 +761,7 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) { // Release the touch. This should end the scroll. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -792,7 +792,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { const int kPositionX = 101; const int kPositionY = 201; delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(kPositionX, kPositionY), kTouchId, GetTime()); @@ -816,7 +816,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { // Release the touch. This should end the scroll. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(kPositionX, kPositionY), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -840,7 +840,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, bounds, NULL)); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); @@ -857,7 +857,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) { delegate.get()); delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -877,7 +877,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, bounds, NULL)); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); @@ -894,7 +894,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) { delegate.get()); delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -914,7 +914,7 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, bounds, NULL)); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); @@ -929,7 +929,7 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) { delegate.get()); delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -960,7 +960,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) { root_window()->SetGestureRecognizerForTesting(gesture_recognizer); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); @@ -975,7 +975,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) { EXPECT_EQ(0, delegate->touch_id()); delegate->Reset(); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); @@ -1002,7 +1002,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) { root_window()->SetGestureRecognizerForTesting(gesture_recognizer); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); @@ -1017,7 +1017,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); @@ -1044,7 +1044,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) { root_window()->SetGestureRecognizerForTesting(gesture_recognizer); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_TRUE(delegate->tap_down()); @@ -1055,7 +1055,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) { // Second tap, to cancel the long press delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. @@ -1068,7 +1068,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) { EXPECT_FALSE(delegate->long_press()); delegate->Reset(); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); @@ -1085,7 +1085,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, bounds, NULL)); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); @@ -1127,7 +1127,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, bounds, NULL)); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); @@ -1171,7 +1171,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); @@ -1184,7 +1184,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { // Make sure there is enough delay before the touch is released so that it is // recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -1198,7 +1198,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { // Now, do a scroll gesture. Delay it sufficiently so that it doesn't trigger // a double-tap. delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, release.time_stamp() + base::TimeDelta::FromMilliseconds(1000)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); @@ -1214,7 +1214,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { // The first movement is diagonal, to ensure that we have a free scroll, // and not a rail scroll. delegate->Reset(); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(130, 230), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 230), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(delegate->tap()); @@ -1228,7 +1228,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { // Move some more to generate a few more scroll updates. delegate->Reset(); - ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(110, 211), + ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(110, 211), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); EXPECT_FALSE(delegate->tap()); @@ -1241,7 +1241,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { EXPECT_EQ(-19, delegate->scroll_y()); delegate->Reset(); - ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(140, 215), + ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(140, 215), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_FALSE(delegate->tap()); @@ -1255,7 +1255,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { // Release the touch. This should end the scroll. delegate->Reset(); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->tap()); @@ -1281,7 +1281,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { // Touch down on the window. This should not generate any gesture event. queued_delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(queued_delegate->tap()); @@ -1295,7 +1295,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { // Introduce some delay before the touch is released so that it is recognized // as a tap. However, this still should not create any gesture events. queued_delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -1315,7 +1315,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -2345, gfx::Rect(0, 0, 50, 50), NULL)); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 20), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 20), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); @@ -1327,7 +1327,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { EXPECT_FALSE(delegate->scroll_update()); EXPECT_FALSE(delegate->scroll_end()); - ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), + ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); @@ -1358,7 +1358,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { // Start all over. Press on the first window, then press again on the second // window. The second press should still go to the first window. queued_delegate->Reset(); - ui::TouchEventImpl press3(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3); EXPECT_FALSE(queued_delegate->tap()); @@ -1374,7 +1374,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { queued_delegate->Reset(); delegate->Reset(); - ui::TouchEventImpl press4(ui::ET_TOUCH_PRESSED, gfx::Point(103, 203), + ui::TouchEvent press4(ui::ET_TOUCH_PRESSED, gfx::Point(103, 203), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press4); EXPECT_FALSE(delegate->tap()); @@ -1399,7 +1399,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { queued_delegate->Reset(); delegate->Reset(); int x_move = ui::GestureConfiguration::max_touch_move_in_pixels_for_click(); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(103 + x_move, 203), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(103 + x_move, 203), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(delegate->tap()); @@ -1472,7 +1472,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { aura::RootWindow* root = root_window(); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); @@ -1485,7 +1485,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { // Move the touch-point enough so that it is considered as a scroll. This // should generate both SCROLL_BEGIN and SCROLL_UPDATE gestures. delegate->Reset(); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(130, 301), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 301), kTouchId1, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(delegate->tap()); @@ -1498,7 +1498,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { // Press the second finger. It should cause pinch-begin. Note that we will not // transition to two finger tap here because the touch points are far enough. delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); @@ -1513,7 +1513,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { // Move the first finger. delegate->Reset(); - ui::TouchEventImpl move3(ui::ET_TOUCH_MOVED, gfx::Point(95, 201), + ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(95, 201), kTouchId1, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3); EXPECT_FALSE(delegate->tap()); @@ -1529,7 +1529,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { // Now move the second finger. delegate->Reset(); - ui::TouchEventImpl move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), + ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), kTouchId2, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); EXPECT_FALSE(delegate->tap()); @@ -1545,7 +1545,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { // Release the first finger. This should end pinch. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -1561,7 +1561,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { // Move the second finger. This should still generate a scroll. delegate->Reset(); - ui::TouchEventImpl move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), + ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), kTouchId2, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5); EXPECT_FALSE(delegate->tap()); @@ -1586,11 +1586,11 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, bounds, NULL)); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); // Since the touch points are far enough we will go to pinch rather than two @@ -1602,7 +1602,7 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( // Pinch has started, now release the second finger delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->pinch_end()); @@ -1612,12 +1612,12 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( // Pinch again delegate->Reset(); - ui::TouchEventImpl press3(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), + ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3); // Now the touch points are close. So we will go into two finger tap. // Move the touch-point enough to break two-finger-tap and enter pinch. - ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 202), + ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 202), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_TRUE(delegate->pinch_begin()); @@ -1640,7 +1640,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { aura::RootWindow* root = root_window(); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), kTouchId1, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); @@ -1654,7 +1654,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { // Press the second finger far enough to break two finger tap. It should // instead cause a scroll-begin and pinch-begin. delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); @@ -1669,7 +1669,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { // Move the first finger. delegate->Reset(); - ui::TouchEventImpl move3(ui::ET_TOUCH_MOVED, gfx::Point(65, 201), + ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(65, 201), kTouchId1, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3); EXPECT_FALSE(delegate->tap()); @@ -1685,7 +1685,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { // Now move the second finger. delegate->Reset(); - ui::TouchEventImpl move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), + ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), kTouchId2, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); EXPECT_FALSE(delegate->tap()); @@ -1701,7 +1701,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { // Release the first finger. This should end pinch. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -1717,7 +1717,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { // Move the second finger. This should still generate a scroll. delegate->Reset(); - ui::TouchEventImpl move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), + ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), kTouchId2, GetTime()); root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5); EXPECT_FALSE(delegate->tap()); @@ -1735,7 +1735,7 @@ TEST_F(GestureRecognizerTest, GestureEventIgnoresDisconnectedEvents) { scoped_ptr<GestureEventConsumeDelegate> delegate( new GestureEventConsumeDelegate()); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), 6, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->tap()); @@ -1773,7 +1773,7 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) { windows[i] = CreateTestWindowWithDelegate( delegates[i], i, *window_bounds[i], NULL); windows[i]->set_id(i); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, window_bounds[i]->origin(), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i]->origin(), i, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); } @@ -1790,10 +1790,10 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) { EXPECT_EQ("3", WindowIDAsString(target)); // Add a touch in the middle associated with windows[2] - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 500), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 500), kNumWindows, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(250, 250), + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(250, 250), kNumWindows, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); @@ -1814,7 +1814,7 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) { EXPECT_TRUE(target == NULL); // Move a touch associated with windows[2] to 1000, 1000 - ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(1000, 1000), + ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(1000, 1000), kNumWindows, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); @@ -1839,11 +1839,11 @@ TEST_F(GestureRecognizerTest, GestureEventOutsideRootWindowTap) { gesture_recognizer->GetGestureSequenceForTesting(root_window()); gfx::Point pos1(-10, -10); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, pos1, 0, GetTime()); + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, pos1, 0, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); gfx::Point pos2(1000, 1000); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, pos2, 1, GetTime()); + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, pos2, 1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); // As these presses were outside the root window, they should be @@ -1862,10 +1862,10 @@ TEST_F(GestureRecognizerTest, NoTapWithPreventDefaultedRelease) { delegate->set_window(window.get()); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -1915,7 +1915,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_FALSE(delegate->tap()); @@ -1928,7 +1928,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { EXPECT_FALSE(delegate->two_finger_tap()); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); @@ -1942,10 +1942,10 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { // Little bit of touch move should not affect our state. delegate->Reset(); - ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(102, 202), + ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(102, 202), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); - ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(131, 202), + ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(131, 202), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_FALSE(delegate->tap()); @@ -1960,7 +1960,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { // Make sure there is enough delay before the touch is released so that it is // recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -1977,7 +1977,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { // Make sure there is enough delay before the touch is released so that it is // recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), + ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), kTouchId2, press2.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -2003,18 +2003,18 @@ TEST_F(GestureRecognizerTest, TwoFingerTapExpired) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); // Send release event after sufficient delay so that two finger time expires. delegate->Reset(); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press1.time_stamp() + base::TimeDelta::FromMilliseconds(1000)); @@ -2025,7 +2025,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapExpired) { // Make sure there is enough delay before the touch is released so that it is // recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), + ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), kTouchId2, press2.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -2048,12 +2048,12 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); @@ -2064,7 +2064,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { // Make sure there is enough delay before the touch is released so that it // is recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId2, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -2080,12 +2080,12 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); @@ -2096,7 +2096,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { // Make sure there is enough delay before the touch is released so that it // is recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -2121,17 +2121,17 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); delegate->Reset(); - ui::TouchEventImpl cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), + ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel); EXPECT_FALSE(delegate->two_finger_tap()); @@ -2139,7 +2139,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { // Make sure there is enough delay before the touch is released so that it // is recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId2, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -2154,17 +2154,17 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); delegate->Reset(); - ui::TouchEventImpl cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), + ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel); EXPECT_FALSE(delegate->two_finger_tap()); @@ -2172,7 +2172,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { // Make sure there is enough delay before the touch is released so that it // is recognized as a tap. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); @@ -2193,7 +2193,7 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_FALSE(delegate->tap()); @@ -2206,7 +2206,7 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) { EXPECT_FALSE(delegate->two_finger_tap()); delegate->Reset(); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(430, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(430, 201), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); @@ -2230,10 +2230,10 @@ TEST_F(GestureRecognizerTest, FlushAllOnHide) { CreateTestWindowWithDelegate(delegate.get(), 0, bounds, NULL)); const int kTouchId1 = 8; const int kTouchId2 = 2; - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), kTouchId2, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); window->Hide(); @@ -2261,7 +2261,7 @@ TEST_F(GestureRecognizerTest, LongPressTimerStopsOnPreventDefaultedTouchMoves) { root_window()->SetGestureRecognizerForTesting(gesture_recognizer); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Scroll around, to cancel the long press @@ -2288,7 +2288,7 @@ class ConsumesTouchMovesDelegate : public GestureEventConsumeDelegate { void set_consume_touch_move(bool consume) { consume_touch_move_ = consume; } private: - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* touch) OVERRIDE { + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* touch) OVERRIDE { if (consume_touch_move_ && touch->type() == ui::ET_TOUCH_MOVED) return ui::TOUCH_STATUS_CONTINUE; return GestureEventConsumeDelegate::OnTouchEvent(touch); @@ -2312,7 +2312,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) { delegate.get(), -1234, bounds, NULL)); delegate->Reset(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); @@ -2380,7 +2380,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) { // Release the touch. This should end the scroll. delegate->Reset(); - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -2406,21 +2406,21 @@ TEST_F(GestureRecognizerTest, GestureEventDoubleTap) { delegate.get(), -1234, bounds, NULL)); // First tap (tested in GestureEventTap) - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201), kTouchId, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); delegate->Reset(); // Second tap - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203), kTouchId, release1.time_stamp() + base::TimeDelta::FromMilliseconds(200)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); - ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206), + ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206), kTouchId, press2.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); @@ -2449,21 +2449,21 @@ TEST_F(GestureRecognizerTest, TwoTapsFarApart) { delegate.get(), -1234, bounds, NULL)); // First tap (tested in GestureEventTap) - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); delegate->Reset(); // Second tap, close in time but far in distance - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), kTouchId, release1.time_stamp() + base::TimeDelta::FromMilliseconds(200)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); - ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(201, 201), + ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(201, 201), kTouchId, press2.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); @@ -2493,21 +2493,21 @@ TEST_F(GestureRecognizerTest, TwoTapsWithDelayBetween) { delegate.get(), -1234, bounds, NULL)); // First tap (tested in GestureEventTap) - ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); - ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press1.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); delegate->Reset(); // Second tap, close in distance but after some delay - ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), + ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, release1.time_stamp() + base::TimeDelta::FromMilliseconds(2000)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); - ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), + ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, press2.time_stamp() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); @@ -2537,14 +2537,14 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, bounds, NULL)); - ui::TouchEventImpl press1( + ui::TouchEvent press1( ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->bounding_box().IsEmpty()); delegate->Reset(); - ui::TouchEventImpl press2( + ui::TouchEvent press2( ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), kTouchId2, press1.time_stamp() + base::TimeDelta::FromMilliseconds(400)); press2.set_radius_x(5); @@ -2553,7 +2553,7 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { delegate->Reset(); - ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(141, 201), kTouchId, + ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(141, 201), kTouchId, press1.time_stamp() + base::TimeDelta::FromMilliseconds(40)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); EXPECT_TRUE(delegate->pinch_begin()); @@ -2563,7 +2563,7 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { delegate->Reset(); // The position doesn't move, but the radius changes. - ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 201), kTouchId, + ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 201), kTouchId, press2.time_stamp() + base::TimeDelta::FromMilliseconds(40)); move2.set_radius_x(50); move2.set_radius_y(60); diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc index a80ead2..d800b6c 100644 --- a/ui/aura/root_window.cc +++ b/ui/aura/root_window.cc @@ -635,7 +635,7 @@ bool RootWindow::ProcessKeyEvent(Window* target, ui::KeyEvent* event) { } ui::TouchStatus RootWindow::ProcessTouchEvent(Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { if (!target->IsVisible()) return ui::TOUCH_STATUS_UNKNOWN; @@ -759,7 +759,7 @@ bool RootWindow::DispatchLongPressGestureEvent(ui::GestureEvent* event) { } bool RootWindow::DispatchCancelTouchEvent(ui::TouchEvent* event) { - return OnHostTouchEvent(static_cast<ui::TouchEventImpl*>(event)); + return OnHostTouchEvent(event); } ui::GestureEvent* RootWindow::CreateGestureEvent( @@ -776,7 +776,7 @@ ui::TouchEvent* RootWindow::CreateTouchEvent(ui::EventType type, const gfx::Point& location, int touch_id, base::TimeDelta time_stamp) { - return new ui::TouchEventImpl(type, location, touch_id, time_stamp); + return new ui::TouchEvent(type, location, touch_id, time_stamp); } void RootWindow::OnLayerAnimationEnded( @@ -856,7 +856,7 @@ bool RootWindow::OnHostScrollEvent(ui::ScrollEvent* event) { return false; } -bool RootWindow::OnHostTouchEvent(ui::TouchEventImpl* event) { +bool RootWindow::OnHostTouchEvent(ui::TouchEvent* event) { DispatchHeldMouseMove(); switch (event->type()) { case ui::ET_TOUCH_PRESSED: @@ -886,7 +886,7 @@ bool RootWindow::OnHostTouchEvent(ui::TouchEventImpl* event) { gesture_recognizer_->GetTouchLockedTarget(event)); if (!target) { target = ConsumerToWindow( - gesture_recognizer_->GetTargetForLocation(event->GetLocation())); + gesture_recognizer_->GetTargetForLocation(event->location())); } } @@ -901,7 +901,7 @@ bool RootWindow::OnHostTouchEvent(ui::TouchEventImpl* event) { return false; } - ui::TouchEventImpl translated_event( + ui::TouchEvent translated_event( *event, static_cast<Window*>(this), target); status = ProcessTouchEvent(target, &translated_event); handled = status != ui::TOUCH_STATUS_UNKNOWN; diff --git a/ui/aura/root_window.h b/ui/aura/root_window.h index 70a77a8..c44c879 100644 --- a/ui/aura/root_window.h +++ b/ui/aura/root_window.h @@ -37,7 +37,7 @@ class KeyEvent; class LayerAnimationSequence; class MouseEvent; class ScrollEvent; -class TouchEventImpl; +class TouchEvent; class Transform; } @@ -271,7 +271,7 @@ class AURA_EXPORT RootWindow : public ui::CompositorDelegate, bool ProcessMouseEvent(Window* target, ui::MouseEvent* event); bool ProcessKeyEvent(Window* target, ui::KeyEvent* event); - ui::TouchStatus ProcessTouchEvent(Window* target, ui::TouchEventImpl* event); + ui::TouchStatus ProcessTouchEvent(Window* target, ui::TouchEvent* event); ui::GestureStatus ProcessGestureEvent(Window* target, ui::GestureEventImpl* event); bool ProcessGestures(ui::GestureRecognizer::Gestures* gestures); @@ -314,7 +314,7 @@ class AURA_EXPORT RootWindow : public ui::CompositorDelegate, virtual bool OnHostKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual bool OnHostMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual bool OnHostScrollEvent(ui::ScrollEvent* event) OVERRIDE; - virtual bool OnHostTouchEvent(ui::TouchEventImpl* event) OVERRIDE; + virtual bool OnHostTouchEvent(ui::TouchEvent* event) OVERRIDE; virtual void OnHostLostCapture() OVERRIDE; virtual void OnHostPaint() OVERRIDE; virtual void OnHostResized(const gfx::Size& size) OVERRIDE; diff --git a/ui/aura/root_window_host_delegate.h b/ui/aura/root_window_host_delegate.h index 1ebeb5f..6bc5852 100644 --- a/ui/aura/root_window_host_delegate.h +++ b/ui/aura/root_window_host_delegate.h @@ -13,7 +13,7 @@ namespace ui { class KeyEvent; class MouseEvent; class ScrollEvent; -class TouchEventImpl; +class TouchEvent; } namespace aura { @@ -27,7 +27,7 @@ class AURA_EXPORT RootWindowHostDelegate { virtual bool OnHostKeyEvent(ui::KeyEvent* event) = 0; virtual bool OnHostMouseEvent(ui::MouseEvent* event) = 0; virtual bool OnHostScrollEvent(ui::ScrollEvent* event) = 0; - virtual bool OnHostTouchEvent(ui::TouchEventImpl* event) = 0; + virtual bool OnHostTouchEvent(ui::TouchEvent* event) = 0; virtual void OnHostLostCapture() = 0; diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc index 45a1c15..b7b1af8 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -645,7 +645,7 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) { case ui::ET_TOUCH_PRESSED: case ui::ET_TOUCH_RELEASED: case ui::ET_TOUCH_MOVED: { - ui::TouchEventImpl touchev(xev); + ui::TouchEvent touchev(xev); delegate_->OnHostTouchEvent(&touchev); break; } diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc index c280653..c236ea4 100644 --- a/ui/aura/root_window_unittest.cc +++ b/ui/aura/root_window_unittest.cc @@ -91,7 +91,7 @@ class EventCountFilter : public EventFilter { return true; } virtual ui::TouchStatus PreHandleTouchEvent( - Window* target, ui::TouchEventImpl* event) OVERRIDE { + Window* target, ui::TouchEvent* event) OVERRIDE { return ui::TOUCH_STATUS_UNKNOWN; } virtual ui::GestureStatus PreHandleGestureEvent( @@ -368,7 +368,7 @@ class EventFilterRecorder : public EventFilter { } virtual ui::TouchStatus PreHandleTouchEvent( Window* target, - ui::TouchEventImpl* event) OVERRIDE { + ui::TouchEvent* event) OVERRIDE { events_.push_back(event->type()); return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ui/aura/shared/compound_event_filter.cc b/ui/aura/shared/compound_event_filter.cc index 60c48fa..08cdb51 100644 --- a/ui/aura/shared/compound_event_filter.cc +++ b/ui/aura/shared/compound_event_filter.cc @@ -124,7 +124,7 @@ bool CompoundEventFilter::PreHandleMouseEvent(Window* target, ui::TouchStatus CompoundEventFilter::PreHandleTouchEvent( Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { ui::TouchStatus status = FilterTouchEvent(target, event); if (status == ui::TOUCH_STATUS_UNKNOWN && event->type() == ui::ET_TOUCH_PRESSED) { @@ -200,7 +200,7 @@ bool CompoundEventFilter::FilterMouseEvent(Window* target, ui::TouchStatus CompoundEventFilter::FilterTouchEvent( Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { ui::TouchStatus status = ui::TOUCH_STATUS_UNKNOWN; if (filters_.might_have_observers()) { ObserverListBase<EventFilter>::Iterator it(filters_); diff --git a/ui/aura/shared/compound_event_filter.h b/ui/aura/shared/compound_event_filter.h index c5a5e83..def8007 100644 --- a/ui/aura/shared/compound_event_filter.h +++ b/ui/aura/shared/compound_event_filter.h @@ -15,7 +15,7 @@ class GestureEventImpl; class KeyEvent; class LocatedEvent; class MouseEvent; -class TouchEventImpl; +class TouchEvent; } namespace aura { @@ -56,7 +56,7 @@ class AURA_EXPORT CompoundEventFilter : public EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( Window* target, ui::GestureEventImpl* event) OVERRIDE; @@ -70,7 +70,7 @@ class AURA_EXPORT CompoundEventFilter : public EventFilter { // ui::TOUCH_STATUS_UNKNOWN if event is consumed. bool FilterKeyEvent(Window* target, ui::KeyEvent* event); bool FilterMouseEvent(Window* target, ui::MouseEvent* event); - ui::TouchStatus FilterTouchEvent(Window* target, ui::TouchEventImpl* event); + ui::TouchStatus FilterTouchEvent(Window* target, ui::TouchEvent* event); // Sets the visibility of the cursor if the event is not synthesized and // |update_cursor_visibility_| is true. diff --git a/ui/aura/shared/compound_event_filter_unittest.cc b/ui/aura/shared/compound_event_filter_unittest.cc index deb076b..b827dfe 100644 --- a/ui/aura/shared/compound_event_filter_unittest.cc +++ b/ui/aura/shared/compound_event_filter_unittest.cc @@ -68,16 +68,16 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) { // This press is required for the GestureRecognizer to associate a target // with kTouchId - ui::TouchEventImpl press( + ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(90, 90), 1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(cursor_client.IsCursorVisible()); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), 1, GetTime()); + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), 1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(cursor_client.IsCursorVisible()); - ui::TouchEventImpl release( + ui::TouchEvent release( ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), 1, GetTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(cursor_client.IsCursorVisible()); diff --git a/ui/aura/shared/input_method_event_filter.cc b/ui/aura/shared/input_method_event_filter.cc index 3ff57f8..eab751c 100644 --- a/ui/aura/shared/input_method_event_filter.cc +++ b/ui/aura/shared/input_method_event_filter.cc @@ -63,7 +63,7 @@ bool InputMethodEventFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus InputMethodEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ui/aura/shared/input_method_event_filter.h b/ui/aura/shared/input_method_event_filter.h index 8806cb5..cbf870e 100644 --- a/ui/aura/shared/input_method_event_filter.h +++ b/ui/aura/shared/input_method_event_filter.h @@ -39,7 +39,7 @@ class AURA_EXPORT InputMethodEventFilter ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator.cc index 5ee24bd..8eaf84b 100644 --- a/ui/aura/test/event_generator.cc +++ b/ui/aura/test/event_generator.cc @@ -23,12 +23,12 @@ class TestKeyEvent : public ui::KeyEvent { } }; -class TestTouchEvent : public ui::TouchEventImpl { +class TestTouchEvent : public ui::TouchEvent { public: TestTouchEvent(ui::EventType type, const gfx::Point& root_location, int flags) - : TouchEventImpl(type, root_location, 0, + : TouchEvent(type, root_location, 0, base::Time::NowFromSystemTime() - base::Time()) { set_flags(flags); } @@ -162,11 +162,11 @@ void EventGenerator::PressMoveAndReleaseTouchToCenterOf(Window* window) { void EventGenerator::GestureTapAt(const gfx::Point& location) { const int kTouchId = 2; - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, location, kTouchId, + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, location, kTouchId, base::Time::NowFromSystemTime() - base::Time()); Dispatch(press); - ui::TouchEventImpl release( + ui::TouchEvent release( ui::ET_TOUCH_RELEASED, location, kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); Dispatch(release); @@ -174,12 +174,12 @@ void EventGenerator::GestureTapAt(const gfx::Point& location) { void EventGenerator::GestureTapDownAndUp(const gfx::Point& location) { const int kTouchId = 3; - ui::TouchEventImpl press( + ui::TouchEvent press( ui::ET_TOUCH_PRESSED, location, kTouchId, base::Time::NowFromSystemTime() - base::Time()); Dispatch(press); - ui::TouchEventImpl release( + ui::TouchEvent release( ui::ET_TOUCH_RELEASED, location, kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(1000)); Dispatch(release); @@ -191,7 +191,7 @@ void EventGenerator::GestureScrollSequence(const gfx::Point& start, int steps) { const int kTouchId = 5; base::TimeDelta timestamp = base::Time::NowFromSystemTime() - base::Time(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, start, kTouchId, timestamp); + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, start, kTouchId, timestamp); Dispatch(press); int dx = (end.x() - start.x()) / steps; @@ -200,11 +200,11 @@ void EventGenerator::GestureScrollSequence(const gfx::Point& start, for (int i = 0; i < steps; ++i) { location.Offset(dx, dy); timestamp += step_delay; - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, location, kTouchId, timestamp); + ui::TouchEvent move(ui::ET_TOUCH_MOVED, location, kTouchId, timestamp); Dispatch(move); } - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, end, kTouchId, timestamp); + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, end, kTouchId, timestamp); Dispatch(release); } @@ -225,7 +225,7 @@ void EventGenerator::GestureMultiFingerScroll(int count, base::TimeDelta press_time = base::Time::NowFromSystemTime() - base::Time(); for (int i = 0; i < count; ++i) { points[i] = start[i]; - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, points[i], i, press_time); + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, points[i], i, press_time); Dispatch(press); } @@ -234,7 +234,7 @@ void EventGenerator::GestureMultiFingerScroll(int count, base::TimeDelta::FromMilliseconds(event_separation_time_ms * step); for (int i = 0; i < count; ++i) { points[i].Offset(delta_x, delta_y); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, points[i], i, move_time); + ui::TouchEvent move(ui::ET_TOUCH_MOVED, points[i], i, move_time); Dispatch(move); } } @@ -242,7 +242,7 @@ void EventGenerator::GestureMultiFingerScroll(int count, base::TimeDelta release_time = press_time + base::TimeDelta::FromMilliseconds(event_separation_time_ms * steps); for (int i = 0; i < count; ++i) { - ui::TouchEventImpl release( + ui::TouchEvent release( ui::ET_TOUCH_RELEASED, points[i], i, release_time); Dispatch(release); } @@ -279,7 +279,7 @@ void EventGenerator::Dispatch(ui::Event& event) { case ui::ET_TOUCH_STATIONARY: case ui::ET_TOUCH_CANCELLED: root_window_->AsRootWindowHostDelegate()->OnHostTouchEvent( - static_cast<ui::TouchEventImpl*>(&event)); + static_cast<ui::TouchEvent*>(&event)); break; default: NOTIMPLEMENTED(); diff --git a/ui/aura/test/test_event_filter.cc b/ui/aura/test/test_event_filter.cc index 421c9c4..00d3e9b 100644 --- a/ui/aura/test/test_event_filter.cc +++ b/ui/aura/test/test_event_filter.cc @@ -38,7 +38,7 @@ bool TestEventFilter::PreHandleMouseEvent(Window* target, ui::TouchStatus TestEventFilter::PreHandleTouchEvent( Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { ++touch_event_count_; // TODO(sadrul): ! return ui::TOUCH_STATUS_UNKNOWN; diff --git a/ui/aura/test/test_event_filter.h b/ui/aura/test/test_event_filter.h index c850fa9..a941d31 100644 --- a/ui/aura/test/test_event_filter.h +++ b/ui/aura/test/test_event_filter.h @@ -44,7 +44,7 @@ class TestEventFilter : public EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( Window* target, ui::GestureEventImpl* event) OVERRIDE; diff --git a/ui/aura/test/test_window_delegate.cc b/ui/aura/test/test_window_delegate.cc index 4e81a18..b350edf 100644 --- a/ui/aura/test/test_window_delegate.cc +++ b/ui/aura/test/test_window_delegate.cc @@ -60,7 +60,7 @@ bool TestWindowDelegate::OnMouseEvent(ui::MouseEvent* event) { return false; } -ui::TouchStatus TestWindowDelegate::OnTouchEvent(ui::TouchEventImpl* event) { +ui::TouchStatus TestWindowDelegate::OnTouchEvent(ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ui/aura/test/test_window_delegate.h b/ui/aura/test/test_window_delegate.h index a23bc5d..38fd7cd 100644 --- a/ui/aura/test/test_window_delegate.h +++ b/ui/aura/test/test_window_delegate.h @@ -38,7 +38,7 @@ class TestWindowDelegate : public WindowDelegate { Window* child, const gfx::Point& location) OVERRIDE; virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE; - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE; + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus OnGestureEvent( ui::GestureEventImpl* event) OVERRIDE; virtual bool CanFocus() OVERRIDE; diff --git a/ui/aura/window_delegate.h b/ui/aura/window_delegate.h index f5cf12f..062b886 100644 --- a/ui/aura/window_delegate.h +++ b/ui/aura/window_delegate.h @@ -21,7 +21,7 @@ namespace ui { class GestureEventImpl; class KeyEvent; class MouseEvent; -class TouchEventImpl; +class TouchEvent; } namespace aura { @@ -58,7 +58,7 @@ class AURA_EXPORT WindowDelegate { virtual bool OnMouseEvent(ui::MouseEvent* event) = 0; - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) = 0; + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) = 0; virtual ui::GestureStatus OnGestureEvent(ui::GestureEventImpl* event) = 0; diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index a26c0d5..afed3cd 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -170,7 +170,7 @@ class CaptureWindowDelegateImpl : public TestWindowDelegate { mouse_event_count_++; return false; } - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE { + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { touch_event_count_++; return ui::TOUCH_STATUS_UNKNOWN; } @@ -433,13 +433,13 @@ TEST_F(WindowTest, HitTest) { EXPECT_TRUE(w1.HitTest(gfx::Point(-1, -1))); EXPECT_FALSE(w1.HitTest(gfx::Point(-2, -2))); - ui::TouchEventImpl pressed( + ui::TouchEvent pressed( ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&pressed); EXPECT_TRUE(w1.HitTest(gfx::Point(-2, -2))); EXPECT_TRUE(w1.HitTest(gfx::Point(-5, -5))); EXPECT_FALSE(w1.HitTest(gfx::Point(-5, -6))); - ui::TouchEventImpl released( + ui::TouchEvent released( ui::ET_TOUCH_RELEASED, gfx::Point(50, 50), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&released); EXPECT_FALSE(w1.HitTest(gfx::Point(-2, -2))); @@ -766,7 +766,7 @@ TEST_F(WindowTest, CaptureTests) { EXPECT_EQ(2, delegate.mouse_event_count()); delegate.ResetCounts(); - ui::TouchEventImpl touchev( + ui::TouchEvent touchev( ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev); EXPECT_EQ(1, delegate.touch_event_count()); @@ -782,7 +782,7 @@ TEST_F(WindowTest, CaptureTests) { generator.PressLeftButton(); EXPECT_EQ(1, delegate.mouse_event_count()); - ui::TouchEventImpl touchev2( + ui::TouchEvent touchev2( ui::ET_TOUCH_PRESSED, gfx::Point(250, 250), 1, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev2); EXPECT_EQ(1, delegate.touch_event_count()); @@ -805,7 +805,7 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) { &delegate2, 0, gfx::Rect(20, 20, 20, 20), NULL)); // Press on w1. - ui::TouchEventImpl press( + ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN. @@ -821,14 +821,14 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) { delegate1.ResetCounts(); delegate2.ResetCounts(); - ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), 0, getTime()); + ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); // This touch id is now ignored, no scroll fired. EXPECT_EQ(0, delegate1.gesture_event_count()); EXPECT_EQ(0, delegate2.gesture_event_count()); - ui::TouchEventImpl release( + ui::TouchEvent release( ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_EQ(0, delegate1.gesture_event_count()); @@ -836,7 +836,7 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) { // A new press is captured by w2. - ui::TouchEventImpl press2( + ui::TouchEvent press2( ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_EQ(0, delegate1.gesture_event_count()); @@ -849,7 +849,7 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) { scoped_ptr<Window> window(CreateTestWindowWithDelegate( &delegate, 0, gfx::Rect(0, 0, 20, 20), NULL)); - ui::TouchEventImpl press( + ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); @@ -863,7 +863,7 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) { // The move event should still create a gesture, as this touch was // on the window which was captured. - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), 0, getTime() + base::TimeDelta::FromMilliseconds(50)); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); @@ -876,7 +876,7 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) { CaptureWindowDelegateImpl d1; scoped_ptr<Window> w1(CreateTestWindowWithDelegate( &d1, 0, gfx::Rect(0, 0, 20, 20), NULL)); - ui::TouchEventImpl p1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); + ui::TouchEvent p1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&p1); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN. EXPECT_EQ(2, d1.gesture_event_count()); @@ -886,7 +886,7 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) { CaptureWindowDelegateImpl d2; scoped_ptr<Window> w2(CreateTestWindowWithDelegate( &d2, 0, gfx::Rect(40, 0, 40, 20), NULL)); - ui::TouchEventImpl p2(ui::ET_TOUCH_PRESSED, gfx::Point(41, 10), 1, getTime()); + ui::TouchEvent p2(ui::ET_TOUCH_PRESSED, gfx::Point(41, 10), 1, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&p2); EXPECT_EQ(0, d1.gesture_event_count()); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN for new target window. @@ -912,7 +912,7 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) { // Move touch id originally associated with |w2|. Since capture was transfered // from 2 to 3 only |w3| should get the event. - ui::TouchEventImpl m3(ui::ET_TOUCH_MOVED, gfx::Point(110, 105), 1, getTime()); + ui::TouchEvent m3(ui::ET_TOUCH_MOVED, gfx::Point(110, 105), 1, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&m3); EXPECT_EQ(0, d1.gesture_event_count()); EXPECT_EQ(0, d2.gesture_event_count()); @@ -1324,7 +1324,7 @@ TEST_F(WindowTest, TransformGesture) { transform.ConcatTranslate(size.height(), 0); root_window()->SetTransform(transform); - ui::TouchEventImpl press( + ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10), 0, getTime()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_EQ(gfx::Point(10, 10).ToString(), delegate->position().ToString()); diff --git a/ui/base/event.cc b/ui/base/event.cc index b25c09a..8a57e70 100644 --- a/ui/base/event.cc +++ b/ui/base/event.cc @@ -224,7 +224,7 @@ void MouseEvent::SetClickCount(int click_count) { MouseEvent::MouseEvent(const MouseEvent& model) : LocatedEvent(model) { } -TouchEventImpl::TouchEventImpl(const base::NativeEvent& native_event) +TouchEvent::TouchEvent(const base::NativeEvent& native_event) : LocatedEvent(native_event), touch_id_(ui::GetTouchId(native_event)), radius_x_(GetTouchRadiusX(native_event)), @@ -233,7 +233,7 @@ TouchEventImpl::TouchEventImpl(const base::NativeEvent& native_event) force_(GetTouchForce(native_event)) { } -TouchEventImpl::TouchEventImpl(EventType type, +TouchEvent::TouchEvent(EventType type, const gfx::Point& location, int touch_id, base::TimeDelta time_stamp) @@ -246,10 +246,10 @@ TouchEventImpl::TouchEventImpl(EventType type, set_time_stamp(time_stamp); } -TouchEventImpl::~TouchEventImpl() { +TouchEvent::~TouchEvent() { } -void TouchEventImpl::UpdateForRootTransform(const Transform& root_transform) { +void TouchEvent::UpdateForRootTransform(const Transform& root_transform) { LocatedEvent::UpdateForRootTransform(root_transform); gfx::Point3f scale; InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale); @@ -259,42 +259,6 @@ void TouchEventImpl::UpdateForRootTransform(const Transform& root_transform) { radius_y_ /= scale.y(); } -EventType TouchEventImpl::GetEventType() const { - return type(); -} - -gfx::Point TouchEventImpl::GetLocation() const { - return location(); -} - -int TouchEventImpl::GetTouchId() const { - return touch_id_; -} - -int TouchEventImpl::GetEventFlags() const { - return flags(); -} - -base::TimeDelta TouchEventImpl::GetTimestamp() const { - return time_stamp(); -} - -float TouchEventImpl::RadiusX() const { - return radius_x_; -} - -float TouchEventImpl::RadiusY() const { - return radius_y_; -} - -float TouchEventImpl::RotationAngle() const { - return rotation_angle_; -} - -float TouchEventImpl::Force() const { - return force_; -} - KeyEvent::KeyEvent(const base::NativeEvent& native_event, bool is_char) : Event(native_event, EventTypeFromNative(native_event), diff --git a/ui/base/event.h b/ui/base/event.h index 4cd59cb..81de5c3 100644 --- a/ui/base/event.h +++ b/ui/base/event.h @@ -192,17 +192,15 @@ class UI_EXPORT MouseEvent : public LocatedEvent { static int GetRepeatCount(const MouseEvent& click_event); }; -// TODO(beng): rename to TouchEvent after conversion is complete. -class UI_EXPORT TouchEventImpl : public LocatedEvent, - public TouchEvent { +class UI_EXPORT TouchEvent : public LocatedEvent { public: - explicit TouchEventImpl(const base::NativeEvent& native_event); + explicit TouchEvent(const base::NativeEvent& native_event); - // Create a new TouchEventImpl which is identical to the provided model. + // Create a new TouchEvent which is identical to the provided model. // If source / target windows are provided, the model location will be // converted from |source| coordinate system to |target| coordinate system. template <class T> - TouchEventImpl(const TouchEventImpl& model, T* source, T* target) + TouchEvent(const TouchEvent& model, T* source, T* target) : LocatedEvent(model, source, target), touch_id_(model.touch_id_), radius_x_(model.radius_x_), @@ -211,12 +209,12 @@ class UI_EXPORT TouchEventImpl : public LocatedEvent, force_(model.force_) { } - TouchEventImpl(EventType type, + TouchEvent(EventType type, const gfx::Point& root_location, int touch_id, base::TimeDelta time_stamp); - virtual ~TouchEventImpl(); + virtual ~TouchEvent(); int touch_id() const { return touch_id_; } float radius_x() const { return radius_x_; } @@ -231,16 +229,17 @@ class UI_EXPORT TouchEventImpl : public LocatedEvent, // Overridden from LocatedEvent. virtual void UpdateForRootTransform(const Transform& root_transform) OVERRIDE; - // Overridden from TouchEvent. - virtual EventType GetEventType() const OVERRIDE; - virtual gfx::Point GetLocation() const OVERRIDE; - virtual int GetTouchId() const OVERRIDE; - virtual int GetEventFlags() const OVERRIDE; - virtual base::TimeDelta GetTimestamp() const OVERRIDE; - virtual float RadiusX() const OVERRIDE; - virtual float RadiusY() const OVERRIDE; - virtual float RotationAngle() const OVERRIDE; - virtual float Force() const OVERRIDE; + protected: + void set_radius(float radius_x, float radius_y) { + radius_x_ = radius_x; + radius_y_ = radius_y; + } + + void set_rotation_angle(float rotation_angle) { + rotation_angle_ = rotation_angle; + } + + void set_force(float force) { force_ = force; } protected: void set_radius(float radius_x, float radius_y) { @@ -271,7 +270,7 @@ class UI_EXPORT TouchEventImpl : public LocatedEvent, // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. float force_; - DISALLOW_COPY_AND_ASSIGN(TouchEventImpl); + DISALLOW_COPY_AND_ASSIGN(TouchEvent); }; class UI_EXPORT KeyEvent : public Event { diff --git a/ui/base/gestures/gesture_point.cc b/ui/base/gestures/gesture_point.cc index 29b3d5a..bbf4d7b1 100644 --- a/ui/base/gestures/gesture_point.cc +++ b/ui/base/gestures/gesture_point.cc @@ -7,6 +7,7 @@ #include <cmath> #include "base/basictypes.h" +#include "ui/base/event.h" #include "ui/base/events.h" #include "ui/base/gestures/gesture_configuration.h" #include "ui/base/gestures/gesture_util.h" @@ -39,22 +40,22 @@ void GesturePoint::ResetVelocity() { void GesturePoint::UpdateValues(const TouchEvent& event) { const int64 event_timestamp_microseconds = - event.GetTimestamp().InMicroseconds(); - if (event.GetEventType() == ui::ET_TOUCH_MOVED) { - velocity_calculator_.PointSeen(event.GetLocation().x(), - event.GetLocation().y(), + event.time_stamp().InMicroseconds(); + if (event.type() == ui::ET_TOUCH_MOVED) { + velocity_calculator_.PointSeen(event.location().x(), + event.location().y(), event_timestamp_microseconds); } - last_touch_time_ = event.GetTimestamp().InSecondsF(); - last_touch_position_ = event.GetLocation(); + last_touch_time_ = event.time_stamp().InSecondsF(); + last_touch_position_ = event.location(); - if (event.GetEventType() == ui::ET_TOUCH_PRESSED) { + if (event.type() == ui::ET_TOUCH_PRESSED) { first_touch_time_ = last_touch_time_; - first_touch_position_ = event.GetLocation(); + first_touch_position_ = event.location(); velocity_calculator_.ClearHistory(); - velocity_calculator_.PointSeen(event.GetLocation().x(), - event.GetLocation().y(), + velocity_calculator_.PointSeen(event.location().x(), + event.location().y(), event_timestamp_microseconds); clear_enclosing_rectangle(); } @@ -86,13 +87,13 @@ bool GesturePoint::IsInDoubleClickWindow(const TouchEvent& event) const { } bool GesturePoint::IsInScrollWindow(const TouchEvent& event) const { - return event.GetEventType() == ui::ET_TOUCH_MOVED && + return event.type() == ui::ET_TOUCH_MOVED && !IsInsideManhattanSquare(event); } bool GesturePoint::IsInFlickWindow(const TouchEvent& event) { return IsOverMinFlickSpeed() && - event.GetEventType() != ui::ET_TOUCH_CANCELLED; + event.type() != ui::ET_TOUCH_CANCELLED; } bool GesturePoint::DidScroll(const TouchEvent& event, int dist) const { @@ -148,13 +149,13 @@ bool GesturePoint::IsInSecondClickTimeWindow() const { } bool GesturePoint::IsInsideManhattanSquare(const TouchEvent& event) const { - return ui::gestures::IsInsideManhattanSquare(event.GetLocation(), + return ui::gestures::IsInsideManhattanSquare(event.location(), first_touch_position_); } bool GesturePoint::IsSecondClickInsideManhattanSquare( const TouchEvent& event) const { - return ui::gestures::IsInsideManhattanSquare(event.GetLocation(), + return ui::gestures::IsInsideManhattanSquare(event.location(), last_tap_position_); } @@ -168,8 +169,8 @@ void GesturePoint::UpdateEnclosingRectangle(const TouchEvent& event) { // Ignore this TouchEvent if it has a radius larger than the maximum // allowed radius size. - if (event.RadiusX() > GestureConfiguration::max_radius() || - event.RadiusY() > GestureConfiguration::max_radius()) + if (event.radius_x() > GestureConfiguration::max_radius() || + event.radius_y() > GestureConfiguration::max_radius()) return; // If the device provides at least one of the radius values, take the larger @@ -178,13 +179,13 @@ void GesturePoint::UpdateEnclosingRectangle(const TouchEvent& event) { // TODO(tdanderson): Implement a more specific check for the exact // information provided by the device (0-2 radii values, force, angle) and // use this to compute a more representative rectangular touch region. - if (event.RadiusX() || event.RadiusY()) - radius = std::max(event.RadiusX(), event.RadiusY()); + if (event.radius_x() || event.radius_y()) + radius = std::max(event.radius_x(), event.radius_y()); else radius = GestureConfiguration::default_radius(); - gfx::Rect rect(event.GetLocation().x() - radius, - event.GetLocation().y() - radius, + gfx::Rect rect(event.location().x() - radius, + event.location().y() - radius, radius * 2, radius * 2); if (IsInClickWindow(event)) diff --git a/ui/base/gestures/gesture_recognizer_impl.cc b/ui/base/gestures/gesture_recognizer_impl.cc index 4c51f8d..caa5054 100644 --- a/ui/base/gestures/gesture_recognizer_impl.cc +++ b/ui/base/gestures/gesture_recognizer_impl.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/time.h" +#include "ui/base/event.h" #include "ui/base/events.h" #include "ui/base/gestures/gesture_configuration.h" #include "ui/base/gestures/gesture_sequence.h" @@ -36,70 +37,20 @@ class ScopedPop { class MirroredTouchEvent : public TouchEvent { public: explicit MirroredTouchEvent(const TouchEvent* real) - : type_(real->GetEventType()), - location_(real->GetLocation()), - touch_id_(real->GetTouchId()), - flags_(real->GetEventFlags()), - timestamp_(real->GetTimestamp()), - radius_x_(real->RadiusX()), - radius_y_(real->RadiusY()), - rotation_angle_(real->RotationAngle()), - force_(real->Force()) { + : TouchEvent(real->type(), + real->location(), + real->touch_id(), + real->time_stamp()) { + set_flags(real->flags()); + set_radius(real->radius_x(), real->radius_y()); + set_rotation_angle(real->rotation_angle()); + set_force(real->force()); } virtual ~MirroredTouchEvent() { } - // Overridden from TouchEvent. - virtual EventType GetEventType() const OVERRIDE { - return type_; - } - - virtual gfx::Point GetLocation() const OVERRIDE { - return location_; - } - - virtual int GetTouchId() const OVERRIDE { - return touch_id_; - } - - virtual int GetEventFlags() const OVERRIDE { - return flags_; - } - - virtual base::TimeDelta GetTimestamp() const OVERRIDE { - return timestamp_; - } - - virtual float RadiusX() const OVERRIDE { - return radius_x_; - } - - virtual float RadiusY() const OVERRIDE { - return radius_y_; - } - - virtual float RotationAngle() const OVERRIDE { - return rotation_angle_; - } - - virtual float Force() const OVERRIDE { - return force_; - } - - protected: - void set_type(const EventType type) { type_ = type; } - private: - EventType type_; - gfx::Point location_; - int touch_id_; - int flags_; - base::TimeDelta timestamp_; - float radius_x_; - float radius_y_; - float rotation_angle_; - float force_; DISALLOW_COPY_AND_ASSIGN(MirroredTouchEvent); }; @@ -178,7 +129,7 @@ GestureRecognizerImpl::~GestureRecognizerImpl() { // Otherwise, returns NULL. GestureConsumer* GestureRecognizerImpl::GetTouchLockedTarget( TouchEvent* event) { - return touch_id_target_[event->GetTouchId()]; + return touch_id_target_[event->touch_id()]; } GestureConsumer* GestureRecognizerImpl::GetTargetForGestureEvent( @@ -282,13 +233,13 @@ GestureSequence::Gestures* GestureRecognizerImpl::ProcessTouchEventForGesture( const TouchEvent& event, ui::TouchStatus status, GestureConsumer* target) { - if (event.GetEventType() == ui::ET_TOUCH_RELEASED || - event.GetEventType() == ui::ET_TOUCH_CANCELLED) { - touch_id_target_[event.GetTouchId()] = NULL; + if (event.type() == ui::ET_TOUCH_RELEASED || + event.type() == ui::ET_TOUCH_CANCELLED) { + touch_id_target_[event.touch_id()] = NULL; } else { - touch_id_target_[event.GetTouchId()] = target; + touch_id_target_[event.touch_id()] = target; if (target) - touch_id_target_for_gestures_[event.GetTouchId()] = target; + touch_id_target_for_gestures_[event.touch_id()] = target; } GestureSequence* gesture_sequence = GetGestureSequenceForConsumer(target); @@ -315,7 +266,7 @@ GestureSequence::Gestures* GestureRecognizerImpl::AdvanceTouchQueue( GestureSequence* sequence = GetGestureSequenceForConsumer(consumer); - if (processed && event->GetEventType() == ui::ET_TOUCH_RELEASED) { + if (processed && event->type() == ui::ET_TOUCH_RELEASED) { // A touch release was was processed (e.g. preventDefault()ed by a // web-page), but we still need to process a touch cancel. CancelledTouchEvent cancelled(event); diff --git a/ui/base/gestures/gesture_sequence.cc b/ui/base/gestures/gesture_sequence.cc index 2f9b1546..5db4b8a 100644 --- a/ui/base/gestures/gesture_sequence.cc +++ b/ui/base/gestures/gesture_sequence.cc @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/time.h" +#include "ui/base/event.h" #include "ui/base/events.h" #include "ui/base/gestures/gesture_configuration.h" #include "ui/base/gestures/gesture_util.h" @@ -283,24 +284,24 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( const TouchEvent& event, ui::TouchStatus status) { StopLongPressTimerIfRequired(event); - last_touch_location_ = event.GetLocation(); + last_touch_location_ = event.location(); if (status == ui::TOUCH_STATUS_QUEUED || status == ui::TOUCH_STATUS_QUEUED_END) return NULL; // Set a limit on the number of simultaneous touches in a gesture. - if (event.GetTouchId() >= kMaxGesturePoints) + if (event.touch_id() >= kMaxGesturePoints) return NULL; - if (event.GetEventType() == ui::ET_TOUCH_PRESSED) { + if (event.type() == ui::ET_TOUCH_PRESSED) { if (point_count_ == kMaxGesturePoints) return NULL; - GesturePoint* new_point = &points_[event.GetTouchId()]; + GesturePoint* new_point = &points_[event.touch_id()]; // We shouldn't be able to get two PRESSED events from the same // finger without either a RELEASE or CANCEL in between. DCHECK(!new_point->in_use()); new_point->set_point_id(point_count_++); - new_point->set_touch_id(event.GetTouchId()); + new_point->set_touch_id(event.touch_id()); } GestureState last_state = state_; @@ -310,23 +311,23 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( GesturePoint& point = GesturePointForEvent(event); point.UpdateValues(event); RecreateBoundingBox(); - flags_ = event.GetEventFlags(); - const int point_id = points_[event.GetTouchId()].point_id(); + flags_ = event.flags(); + const int point_id = points_[event.touch_id()].point_id(); if (point_id < 0) return NULL; // Send GESTURE_BEGIN for any touch pressed. - if (event.GetEventType() == ui::ET_TOUCH_PRESSED) + if (event.type() == ui::ET_TOUCH_PRESSED) AppendBeginGestureEvent(point, gestures.get()); TouchStatusInternal status_internal = (status == ui::TOUCH_STATUS_UNKNOWN) ? TSI_NOT_PROCESSED : TSI_PROCESSED; EdgeStateSignatureType signature = Signature(state_, point_id, - event.GetEventType(), status_internal); + event.type(), status_internal); if (signature == GST_INVALID) - signature = Signature(state_, point_id, event.GetEventType(), TSI_ALWAYS); + signature = Signature(state_, point_id, event.type(), TSI_ALWAYS); switch (signature) { case GST_INVALID: @@ -439,14 +440,14 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( break; } - if (event.GetEventType() == ui::ET_TOUCH_RELEASED || - event.GetEventType() == ui::ET_TOUCH_CANCELLED) + if (event.type() == ui::ET_TOUCH_RELEASED || + event.type() == ui::ET_TOUCH_CANCELLED) AppendEndGestureEvent(point, gestures.get()); if (state_ != last_state) DVLOG(4) << "Gesture Sequence" << " State: " << state_ - << " touch id: " << event.GetTouchId(); + << " touch id: " << event.touch_id(); if (last_state == GS_PENDING_SYNTHETIC_CLICK && state_ != last_state) long_press_timer_->Stop(); @@ -455,9 +456,9 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( // When a touch point is released, all points with ids greater than the // released point must have their ids decremented, or the set of point_ids // could end up with gaps. - if (event.GetEventType() == ui::ET_TOUCH_RELEASED || - event.GetEventType() == ui::ET_TOUCH_CANCELLED) { - GesturePoint& old_point = points_[event.GetTouchId()]; + if (event.type() == ui::ET_TOUCH_RELEASED || + event.type() == ui::ET_TOUCH_CANCELLED) { + GesturePoint& old_point = points_[event.touch_id()]; for (int i = 0; i < kMaxGesturePoints; ++i) { GesturePoint& point = points_[i]; if (point.point_id() > old_point.point_id()) @@ -526,7 +527,7 @@ base::OneShotTimer<GestureSequence>* GestureSequence::CreateTimer() { GesturePoint& GestureSequence::GesturePointForEvent( const TouchEvent& event) { - return points_[event.GetTouchId()]; + return points_[event.touch_id()]; } GesturePoint* GestureSequence::GetPointByPointId(int point_id) { @@ -824,7 +825,7 @@ bool GestureSequence::TwoFingerTouchDown(const TouchEvent& event, AppendScrollGestureEnd(point, point.last_touch_position(), gestures, 0.f, 0.f); } - second_touch_time_ = event.GetTimestamp(); + second_touch_time_ = event.time_stamp(); return true; } @@ -832,7 +833,7 @@ bool GestureSequence::TwoFingerTouchMove(const TouchEvent& event, const GesturePoint& point, Gestures* gestures) { DCHECK(state_ == GS_PENDING_TWO_FINGER_TAP); - base::TimeDelta time_delta = event.GetTimestamp() - second_touch_time_; + base::TimeDelta time_delta = event.time_stamp() - second_touch_time_; base::TimeDelta max_delta = base::TimeDelta::FromMilliseconds(1000 * ui::GestureConfiguration::max_touch_down_duration_in_seconds_for_click()); if (time_delta > max_delta || !point.IsInsideManhattanSquare(event)) { @@ -845,7 +846,7 @@ bool GestureSequence::TwoFingerTouchMove(const TouchEvent& event, bool GestureSequence::TwoFingerTouchReleased(const TouchEvent& event, const GesturePoint& point, Gestures* gestures) { DCHECK(state_ == GS_PENDING_TWO_FINGER_TAP); - base::TimeDelta time_delta = event.GetTimestamp() - second_touch_time_; + base::TimeDelta time_delta = event.time_stamp() - second_touch_time_; base::TimeDelta max_delta = base::TimeDelta::FromMilliseconds(1000 * ui::GestureConfiguration::max_touch_down_duration_in_seconds_for_click()); if (time_delta < max_delta && point.IsInsideManhattanSquare(event)) @@ -1022,13 +1023,13 @@ bool GestureSequence::MaybeSwipe(const TouchEvent& event, void GestureSequence::StopLongPressTimerIfRequired(const TouchEvent& event) { if (!long_press_timer_->IsRunning() || - event.GetEventType() != ui::ET_TOUCH_MOVED) + event.type() != ui::ET_TOUCH_MOVED) return; // Since long press timer has been started, there should be a non-NULL point. const GesturePoint* point = GetPointByPointId(0); if (!ui::gestures::IsInsideManhattanSquare(point->first_touch_position(), - event.GetLocation())) + event.location())) long_press_timer_->Stop(); } diff --git a/ui/base/gestures/gesture_types.h b/ui/base/gestures/gesture_types.h index b84faee..48dae70 100644 --- a/ui/base/gestures/gesture_types.h +++ b/ui/base/gestures/gesture_types.h @@ -12,6 +12,8 @@ namespace ui { +class TouchEvent; + struct UI_EXPORT GestureEventDetails { public: GestureEventDetails(EventType type, float delta_x, float delta_y); @@ -113,23 +115,6 @@ struct UI_EXPORT GestureEventDetails { gfx::Rect bounding_box_; }; -// An abstract type to represent touch-events. The gesture-recognizer uses this -// interface to communicate with the touch-events. -class UI_EXPORT TouchEvent { - public: - virtual ~TouchEvent() {} - - virtual EventType GetEventType() const = 0; - virtual gfx::Point GetLocation() const = 0; - virtual int GetTouchId() const = 0; - virtual int GetEventFlags() const = 0; - virtual base::TimeDelta GetTimestamp() const = 0; - virtual float RadiusX() const = 0; - virtual float RadiusY() const = 0; - virtual float RotationAngle() const = 0; - virtual float Force() const = 0; -}; - // An abstract type to represent gesture-events. class UI_EXPORT GestureEvent { public: @@ -187,9 +172,9 @@ class UI_EXPORT GestureEventHelper { unsigned int touch_id_bitfield) = 0; virtual TouchEvent* CreateTouchEvent(EventType type, - const gfx::Point& location, - int touch_id, - base::TimeDelta time_stamp) = 0; + const gfx::Point& location, + int touch_id, + base::TimeDelta time_stamp) = 0; virtual bool DispatchLongPressGestureEvent(GestureEvent* event) = 0; virtual bool DispatchCancelTouchEvent(TouchEvent* event) = 0; diff --git a/ui/views/events/event_aura.cc b/ui/views/events/event_aura.cc index ae3f5ff..41253a0 100644 --- a/ui/views/events/event_aura.cc +++ b/ui/views/events/event_aura.cc @@ -23,12 +23,12 @@ LocatedEvent::LocatedEvent(const NativeEvent& native_event) TouchEvent::TouchEvent(const NativeEvent& event) : LocatedEvent(event), - touch_id_(static_cast<ui::TouchEventImpl*>(event)->touch_id()), - radius_x_(static_cast<ui::TouchEventImpl*>(event)->radius_x()), - radius_y_(static_cast<ui::TouchEventImpl*>(event)->radius_y()), + touch_id_(static_cast<ui::TouchEvent*>(event)->touch_id()), + radius_x_(static_cast<ui::TouchEvent*>(event)->radius_x()), + radius_y_(static_cast<ui::TouchEvent*>(event)->radius_y()), rotation_angle_( - static_cast<ui::TouchEventImpl*>(event)->rotation_angle()), - force_(static_cast<ui::TouchEventImpl*>(event)->force()) { + static_cast<ui::TouchEvent*>(event)->rotation_angle()), + force_(static_cast<ui::TouchEvent*>(event)->force()) { } //////////////////////////////////////////////////////////////////////////////// diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index 150cc79..8b5551f 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -810,7 +810,7 @@ bool NativeWidgetAura::OnMouseEvent(ui::MouseEvent* event) { return delegate_->OnMouseEvent(mouse_event); } -ui::TouchStatus NativeWidgetAura::OnTouchEvent(ui::TouchEventImpl* event) { +ui::TouchStatus NativeWidgetAura::OnTouchEvent(ui::TouchEvent* event) { DCHECK(window_->IsVisible()); TouchEvent touch_event(event); return delegate_->OnTouchEvent(touch_event); diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h index b45c939..6a3ad2ee 100644 --- a/ui/views/widget/native_widget_aura.h +++ b/ui/views/widget/native_widget_aura.h @@ -139,7 +139,7 @@ class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, aura::Window* child, const gfx::Point& location) OVERRIDE; virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE; - virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE; + virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus OnGestureEvent( ui::GestureEventImpl* event) OVERRIDE; virtual bool CanFocus() OVERRIDE; diff --git a/ui/views/widget/native_widget_aura_unittest.cc b/ui/views/widget/native_widget_aura_unittest.cc index a7f0176..8181c9b 100644 --- a/ui/views/widget/native_widget_aura_unittest.cc +++ b/ui/views/widget/native_widget_aura_unittest.cc @@ -252,7 +252,7 @@ TEST_F(NativeWidgetAuraTest, DontCaptureOnGesture) { widget->SetContentsView(view); widget->Show(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(41, 51), 1, + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(41, 51), 1, base::TimeDelta()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Both views should get the press. @@ -265,7 +265,7 @@ TEST_F(NativeWidgetAuraTest, DontCaptureOnGesture) { // Release touch. Only |view| should get the release since that it consumed // the press. - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(250, 251), 1, + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(250, 251), 1, base::TimeDelta()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(view->got_gesture_event()); @@ -287,7 +287,7 @@ TEST_F(NativeWidgetAuraTest, ReleaseCaptureOnTouchRelease) { widget->SetContentsView(view); widget->Show(); - ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(41, 51), 1, + ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(41, 51), 1, base::TimeDelta()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_TRUE(view->got_gesture_event()); @@ -297,7 +297,7 @@ TEST_F(NativeWidgetAuraTest, ReleaseCaptureOnTouchRelease) { EXPECT_TRUE(widget->HasCapture()); // Generate a release, this should trigger releasing capture. - ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(41, 51), 1, + ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(41, 51), 1, base::TimeDelta()); root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(view->got_gesture_event()); diff --git a/ui/views/widget/x11_window_event_filter.cc b/ui/views/widget/x11_window_event_filter.cc index 133f871..72eaeca 100644 --- a/ui/views/widget/x11_window_event_filter.cc +++ b/ui/views/widget/x11_window_event_filter.cc @@ -131,7 +131,7 @@ bool X11WindowEventFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus X11WindowEventFilter::PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) { + ui::TouchEvent* event) { return ui::TOUCH_STATUS_UNKNOWN; } diff --git a/ui/views/widget/x11_window_event_filter.h b/ui/views/widget/x11_window_event_filter.h index 41b06e9..1ef27f3 100644 --- a/ui/views/widget/x11_window_event_filter.h +++ b/ui/views/widget/x11_window_event_filter.h @@ -43,7 +43,7 @@ class VIEWS_EXPORT X11WindowEventFilter : public aura::EventFilter { ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, - ui::TouchEventImpl* event) OVERRIDE; + ui::TouchEvent* event) OVERRIDE; virtual ui::GestureStatus PreHandleGestureEvent( aura::Window* target, ui::GestureEventImpl* event) OVERRIDE; |