diff options
author | tdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-11 18:50:19 +0000 |
---|---|---|
committer | tdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-11 18:50:19 +0000 |
commit | dd4ed7014cc46ff33c96aaf20d65d227a0996134 (patch) | |
tree | 387ffb2d8e8d65a8d44905148dfd770a2dc3699a /ui/views/corewm | |
parent | dcf4f2f2ba013de3293ca2fa09462ad6d4684ed8 (diff) | |
download | chromium_src-dd4ed7014cc46ff33c96aaf20d65d227a0996134.zip chromium_src-dd4ed7014cc46ff33c96aaf20d65d227a0996134.tar.gz chromium_src-dd4ed7014cc46ff33c96aaf20d65d227a0996134.tar.bz2 |
Make Widget an EventSource and RootView an EventProcessor
This CL makes a few changes in preparation for adding a ViewTargeter
and using EventProcessor::OnEventFromSource():
* Widget is now an EventSource.
* RootView is now an EventProcessor.
* With the exception of mouse events, Widget uses SendEventToProcessor()
to send events to RootView.
* The Dispatch*Event() functions in RootView have been made private
(or protected, in the case of DispatchGestureEvent()) to disallow
invocation from outside the class. These will eventually be removed.
* Added a temporary override of OnEventFromSource() to RootView,
which calls the private/protected Dispatch*Event() functions. Once
the code for a specific event type has been refactored, I will only
need to make a one-line change to instead call
EventProcessor::OnEventFromSource() for targeting and dispatch.
* Updated tests to call OnEventFromSource() instead of
Dispatch*Event().
BUG=348077
TEST=none
Review URL: https://codereview.chromium.org/180453003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/corewm')
-rw-r--r-- | ui/views/corewm/desktop_capture_controller_unittest.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/views/corewm/desktop_capture_controller_unittest.cc b/ui/views/corewm/desktop_capture_controller_unittest.cc index 18b3976..679af19 100644 --- a/ui/views/corewm/desktop_capture_controller_unittest.cc +++ b/ui/views/corewm/desktop_capture_controller_unittest.cc @@ -130,6 +130,7 @@ TEST_F(DesktopCaptureControllerTest, CaptureWindowInputEventTest) { aura::client::SetScreenPositionClient( widget2->GetNativeView()->GetRootWindow(), desktop_position_client2.get()); + ui::EventDispatchDetails details; DesktopViewInputTest* v2 = new DesktopViewInputTest(); v2->SetBoundsRect(gfx::Rect(0, 0, 300, 300)); @@ -150,7 +151,10 @@ TEST_F(DesktopCaptureControllerTest, CaptureWindowInputEventTest) { base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0.0f, 0.0f), 0); - root1->DispatchGestureEvent(&g1); + details = root1->OnEventFromSource(&g1); + EXPECT_FALSE(details.dispatcher_destroyed); + EXPECT_FALSE(details.target_destroyed); + EXPECT_TRUE(v1->received_gesture_event()); EXPECT_FALSE(v2->received_gesture_event()); v1->Reset(); @@ -162,7 +166,10 @@ TEST_F(DesktopCaptureControllerTest, CaptureWindowInputEventTest) { EXPECT_TRUE(widget2->GetNativeView()->HasCapture()); EXPECT_EQ(capture_client->GetCaptureWindow(), widget2->GetNativeView()); - root2->DispatchGestureEvent(&g1); + details = root2->OnEventFromSource(&g1); + EXPECT_FALSE(details.dispatcher_destroyed); + EXPECT_FALSE(details.target_destroyed); + EXPECT_TRUE(v2->received_gesture_event()); EXPECT_FALSE(v1->received_gesture_event()); |