diff options
36 files changed, 248 insertions, 229 deletions
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index 77bbe6f..d437bc5 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc @@ -26,8 +26,8 @@ #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" #include "ui/events/event.h" +#include "ui/events/event_processor.h" #include "ui/gfx/screen.h" #if defined(USE_X11) @@ -635,8 +635,8 @@ TEST_F(AcceleratorControllerTest, MAYBE_ProcessOnce) { GetController()->Register(accelerator_a, &target); // The accelerator is processed only once. - aura::WindowEventDispatcher* dispatcher = - Shell::GetPrimaryRootWindow()->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = + Shell::GetPrimaryRootWindow()->GetHost()->event_processor(); #if defined(OS_WIN) MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 }; ui::TranslatedKeyEvent key_event1(msg1, false); diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index 600cdef..dbab079 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -788,15 +788,13 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { // The lock window should get events on both root windows. aura::test::EventGenerator& event_generator(GetEventGenerator()); - event_generator.set_current_dispatcher( - root_windows[0]->GetHost()->dispatcher()); + event_generator.set_current_host(root_windows[0]->GetHost()); event_generator.PressKey(ui::VKEY_A, 0); event_generator.ReleaseKey(ui::VKEY_A, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); EXPECT_EQ("a", UTF16ToASCII(textfield->text())); - event_generator.set_current_dispatcher( - root_windows[1]->GetHost()->dispatcher()); + event_generator.set_current_host(root_windows[1]->GetHost()); event_generator.PressKey(ui::VKEY_B, 0); event_generator.ReleaseKey(ui::VKEY_B, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); @@ -813,15 +811,13 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { // on both root windows. UpdateDisplay("100x100,200x200"); root_windows = Shell::GetAllRootWindows(); - event_generator.set_current_dispatcher( - root_windows[0]->GetHost()->dispatcher()); + event_generator.set_current_host(root_windows[0]->GetHost()); event_generator.PressKey(ui::VKEY_D, 0); event_generator.ReleaseKey(ui::VKEY_D, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); EXPECT_EQ("abcd", UTF16ToASCII(textfield->text())); - event_generator.set_current_dispatcher( - root_windows[1]->GetHost()->dispatcher()); + event_generator.set_current_host(root_windows[1]->GetHost()); event_generator.PressKey(ui::VKEY_E, 0); event_generator.ReleaseKey(ui::VKEY_E, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); diff --git a/ash/sticky_keys/sticky_keys_unittest.cc b/ash/sticky_keys/sticky_keys_unittest.cc index e552c22..dda01d8 100644 --- a/ash/sticky_keys/sticky_keys_unittest.cc +++ b/ash/sticky_keys/sticky_keys_unittest.cc @@ -15,8 +15,9 @@ #include "base/callback.h" #include "base/memory/scoped_vector.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" #include "ui/events/event_handler.h" +#include "ui/events/event_processor.h" #include "ui/events/test/events_test_utils_x11.h" #include "ui/events/x/device_data_manager.h" @@ -263,7 +264,7 @@ class StickyKeysTest : public test::AshTestBase, handler->HandleKeyEvent(ev.get()); } - void SendActivateStickyKeyPattern(aura::WindowEventDispatcher* dispatcher, + void SendActivateStickyKeyPattern(ui::EventProcessor* dispatcher, ui::KeyboardCode key_code) { scoped_ptr<ui::KeyEvent> ev; ev.reset(GenerateKey(true, key_code)); @@ -793,8 +794,8 @@ TEST_F(StickyKeysTest, KeyEventDispatchImpl) { // Test the actual key event dispatch implementation. EventBuffer buffer; ScopedVector<ui::Event> events; - aura::WindowEventDispatcher* dispatcher = - Shell::GetPrimaryRootWindow()->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = + Shell::GetPrimaryRootWindow()->GetHost()->event_processor(); Shell::GetInstance()->AddPreTargetHandler(&buffer); Shell::GetInstance()->sticky_keys_controller()->Enable(true); @@ -833,8 +834,8 @@ TEST_F(StickyKeysTest, MouseEventDispatchImpl) { // Test the actual sticky mouse event dispatch implementation. EventBuffer buffer; ScopedVector<ui::Event> events; - aura::WindowEventDispatcher* dispatcher = - Shell::GetPrimaryRootWindow()->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = + Shell::GetPrimaryRootWindow()->GetHost()->event_processor(); Shell::GetInstance()->AddPreTargetHandler(&buffer); Shell::GetInstance()->sticky_keys_controller()->Enable(true); @@ -870,8 +871,8 @@ TEST_F(StickyKeysTest, MouseWheelEventDispatchImpl) { // Test the actual mouse wheel event dispatch implementation. EventBuffer buffer; ScopedVector<ui::Event> events; - aura::WindowEventDispatcher* dispatcher = - Shell::GetPrimaryRootWindow()->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = + Shell::GetPrimaryRootWindow()->GetHost()->event_processor(); Shell::GetInstance()->AddPreTargetHandler(&buffer); Shell::GetInstance()->sticky_keys_controller()->Enable(true); diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index ecc1e8f..9c9cbe3 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -58,12 +58,12 @@ class AshEventGeneratorDelegate : public aura::test::EventGeneratorDelegate { virtual ~AshEventGeneratorDelegate() {} // aura::test::EventGeneratorDelegate overrides: - virtual aura::WindowEventDispatcher* GetDispatcherAt( + virtual aura::WindowTreeHost* GetHostAt( const gfx::Point& point_in_screen) const OVERRIDE { gfx::Screen* screen = Shell::GetScreen(); gfx::Display display = screen->GetDisplayNearestPoint(point_in_screen); return Shell::GetInstance()->display_controller()-> - GetRootWindowForDisplayId(display.id())->GetHost()->dispatcher(); + GetRootWindowForDisplayId(display.id())->GetHost(); } virtual aura::client::ScreenPositionClient* GetScreenPositionClient( diff --git a/ash/wm/caption_buttons/frame_maximize_button_unittest.cc b/ash/wm/caption_buttons/frame_maximize_button_unittest.cc index d3bccbd..23b60f5 100644 --- a/ash/wm/caption_buttons/frame_maximize_button_unittest.cc +++ b/ash/wm/caption_buttons/frame_maximize_button_unittest.cc @@ -16,7 +16,8 @@ #include "ui/aura/client/focus_client.h" #include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" +#include "ui/events/event_processor.h" #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_configuration.h" #include "ui/views/widget/widget.h" @@ -485,8 +486,7 @@ TEST_F(FrameMaximizeButtonTest, MaximizeTap) { ui::GestureConfiguration::default_radius(); ui::GestureConfiguration::set_default_radius(0); - aura::WindowEventDispatcher* dispatcher = - root_window->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor(); const int kTouchId = 2; ui::TouchEvent press(ui::ET_TOUCH_PRESSED, button_pos, diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index af15f3e..bccd62a 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -18,10 +18,10 @@ #include "ui/aura/test/test_event_handler.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" -#include "ui/aura/window_event_dispatcher.h" #include "ui/base/cursor/cursor.h" #include "ui/base/hit_test.h" #include "ui/events/event.h" +#include "ui/events/event_processor.h" #include "ui/events/event_utils.h" #include "ui/gfx/screen.h" #include "ui/views/corewm/compound_event_filter.h" @@ -183,8 +183,7 @@ TEST_F(WindowManagerTest, Focus) { aura::client::GetFocusClient(w121.get()); EXPECT_EQ(w121.get(), focus_client->GetFocusedWindow()); - aura::WindowEventDispatcher* dispatcher = - root_window->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor(); // The key press should be sent to the focused sub-window. ui::KeyEvent keyev(ui::ET_KEY_PRESSED, ui::VKEY_E, 0, false); @@ -447,8 +446,7 @@ TEST_F(WindowManagerTest, ActivateOnTouch) { aura::Window::ConvertPointToTarget(w2->parent(), root_window, &press_point); ui::TouchEvent touchev1(ui::ET_TOUCH_PRESSED, press_point, 0, getTime()); - aura::WindowEventDispatcher* dispatcher = - root_window->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor(); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&touchev1); ASSERT_FALSE(details.dispatcher_destroyed); @@ -510,12 +508,11 @@ TEST_F(WindowManagerTest, MouseEventCursors) { gfx::Point point2(kWindowLeft + 1, kWindowTop + 1); aura::Window::ConvertPointToTarget(window->parent(), root_window, &point2); - aura::WindowEventDispatcher* dispatcher = - root_window->GetHost()->dispatcher(); + aura::WindowTreeHost* host = root_window->GetHost(); + ui::EventProcessor* dispatcher = host->event_processor(); // Cursor starts as a pointer (set during Shell::Init()). - EXPECT_EQ(ui::kCursorPointer, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorPointer, host->last_cursor().native_type()); { // Resize edges and corners show proper cursors. @@ -523,8 +520,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorSouthResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorSouthResize, host->last_cursor().native_type()); } { @@ -532,8 +528,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorSouthWestResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorSouthWestResize, host->last_cursor().native_type()); } { @@ -541,8 +536,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorSouthEastResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorSouthEastResize, host->last_cursor().native_type()); } { @@ -550,8 +544,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorWestResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorWestResize, host->last_cursor().native_type()); } { @@ -559,8 +552,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorEastResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorEastResize, host->last_cursor().native_type()); } { @@ -568,8 +560,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorNorthResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorNorthResize, host->last_cursor().native_type()); } { @@ -577,8 +568,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorNorthWestResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorNorthWestResize, host->last_cursor().native_type()); } { @@ -586,8 +576,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorNorthEastResize, - dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorNorthEastResize, host->last_cursor().native_type()); } { @@ -596,7 +585,7 @@ TEST_F(WindowManagerTest, MouseEventCursors) { ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0, 0); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1); ASSERT_FALSE(details.dispatcher_destroyed); - EXPECT_EQ(ui::kCursorNull, dispatcher->host()->last_cursor().native_type()); + EXPECT_EQ(ui::kCursorNull, host->last_cursor().native_type()); } } @@ -632,8 +621,7 @@ TEST_F(WindowManagerTest, MAYBE_TransformActivate) { miss_point, ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); - aura::WindowEventDispatcher* dispatcher = - root_window->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor(); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&mouseev1); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(NULL, aura::client::GetFocusClient(w1.get())->GetFocusedWindow()); @@ -685,8 +673,7 @@ TEST_F(WindowManagerTest, AdditionalFilters) { // Dispatches mouse and keyboard events. ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false); - aura::WindowEventDispatcher* dispatcher = - root_window->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor(); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&key_event); ASSERT_FALSE(details.dispatcher_destroyed); ui::MouseEvent mouse_pressed( diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc index 2447e01..17f2789 100644 --- a/ash/wm/workspace/workspace_event_handler_unittest.cc +++ b/ash/wm/workspace/workspace_event_handler_unittest.cc @@ -17,8 +17,9 @@ #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" #include "ui/base/hit_test.h" +#include "ui/events/event_processor.h" #include "ui/gfx/screen.h" #include "ui/views/corewm/window_util.h" @@ -379,7 +380,7 @@ TEST_F(WorkspaceEventHandlerTest, generator.current_location(), ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK, ui::EF_MIDDLE_MOUSE_BUTTON); - aura::WindowEventDispatcher* dispatcher = root->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = root->GetHost()->event_processor(); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); ASSERT_FALSE(details.dispatcher_destroyed); ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc index 39660a8..7fe3d93 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine.cc +++ b/chrome/browser/chromeos/input_method/input_method_engine.cc @@ -27,10 +27,11 @@ #include "chromeos/ime/extension_ime_util.h" #include "chromeos/ime/input_method_manager.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" #include "ui/base/ime/candidate_window.h" #include "ui/base/ime/chromeos/ime_keymap.h" #include "ui/events/event.h" +#include "ui/events/event_processor.h" #include "ui/events/keycodes/dom4/keycode_converter.h" #include "ui/events/keycodes/keyboard_code_conversion_x.h" #include "ui/keyboard/keyboard_controller.h" @@ -221,8 +222,8 @@ bool InputMethodEngine::SendKeyEvents( return false; } - aura::WindowEventDispatcher* dispatcher = - ash::Shell::GetPrimaryRootWindow()->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = + ash::Shell::GetPrimaryRootWindow()->GetHost()->event_processor(); for (size_t i = 0; i < events.size(); ++i) { const KeyboardEvent& event = events[i]; diff --git a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc index 38165d6..1bfc553 100644 --- a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc +++ b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc @@ -62,7 +62,8 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40), gfx::Point(40, 40), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move.target()); } @@ -77,7 +78,8 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40), gfx::Point(40, 40), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(root_window(), move.target()); @@ -85,7 +87,7 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) { ui::MouseEvent move2(ui::ET_MOUSE_MOVED, gfx::Point(80, 80), gfx::Point(80, 80), ui::EF_NONE, ui::EF_NONE); - details = dispatcher()->OnEventFromSource(&move2); + details = event_processor()->OnEventFromSource(&move2); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move2.target()); } @@ -106,7 +108,8 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40), gfx::Point(40, 40), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move.target()); } @@ -117,7 +120,8 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move.target()); } @@ -132,7 +136,8 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(root_window(), move.target()); } @@ -144,7 +149,8 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move.target()); } @@ -160,7 +166,8 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(80, 80), gfx::Point(80, 80), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move.target()); } @@ -171,7 +178,8 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(32, 37), gfx::Point(32, 37), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move.target()); } @@ -185,7 +193,8 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(80, 80), gfx::Point(80, 80), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(window, move.target()); } @@ -196,7 +205,8 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) { ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(32, 37), gfx::Point(32, 37), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(root_window(), move.target()); } diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc index 7081677..f589098 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc @@ -21,7 +21,8 @@ #if defined(USE_AURA) #include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" +#include "ui/events/event_processor.h" #endif // defined(USE_AURA) class OmniboxViewViewsTest : public InProcessBrowserTest { @@ -76,8 +77,8 @@ class OmniboxViewViewsTest : public InProcessBrowserTest { // Touch down and release at the specified locations. void Tap(const gfx::Point& press_location, const gfx::Point& release_location) { - aura::WindowEventDispatcher* dispatcher = - browser()->window()->GetNativeWindow()->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = + browser()->window()->GetNativeWindow()->GetHost()->event_processor(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, press_location, 5, base::TimeDelta::FromMilliseconds(0)); diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index e8ce43e..77a682c 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc @@ -220,9 +220,9 @@ class ScreenEventGeneratorDelegate : public aura::test::EventGeneratorDelegate { virtual ~ScreenEventGeneratorDelegate() {} // EventGeneratorDelegate overrides: - virtual aura::WindowEventDispatcher* GetDispatcherAt( + virtual aura::WindowTreeHost* GetHostAt( const gfx::Point& point) const OVERRIDE { - return root_window_->GetHost()->dispatcher(); + return root_window_->GetHost(); } virtual aura::client::ScreenPositionClient* GetScreenPositionClient( diff --git a/content/browser/web_contents/aura/window_slider_unittest.cc b/content/browser/web_contents/aura/window_slider_unittest.cc index 94816e3..ed41347 100644 --- a/content/browser/web_contents/aura/window_slider_unittest.cc +++ b/content/browser/web_contents/aura/window_slider_unittest.cc @@ -10,12 +10,12 @@ #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" #include "ui/base/hit_test.h" +#include "ui/events/event_processor.h" namespace content { -void DispatchEventDuringScrollCallback(aura::WindowEventDispatcher* dispatcher, +void DispatchEventDuringScrollCallback(ui::EventProcessor* dispatcher, ui::Event* event, ui::EventType type, const gfx::Vector2dF& delta) { @@ -265,7 +265,7 @@ TEST_F(WindowSliderTest, WindowSlideIsCancelledOnEvent) { base::TimeDelta::FromMilliseconds(10), 1, base::Bind(&DispatchEventDuringScrollCallback, - root_window()->GetHost()->dispatcher(), + root_window()->GetHost()->event_processor(), base::Owned(events[i]))); EXPECT_TRUE(slider_delegate.created_back_layer()); EXPECT_TRUE(slider_delegate.slide_aborted()); diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc index 95e41b8..05e277b 100644 --- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc +++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc @@ -27,8 +27,9 @@ #include "content/test/content_browser_test_utils.h" #include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/events/event_processor.h" namespace content { @@ -322,7 +323,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, EXPECT_EQ(1, GetCurrentIndex()); aura::Window* content = web_contents->GetView()->GetContentNativeView(); - aura::WindowEventDispatcher* dispatcher = content->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = content->GetHost()->event_processor(); gfx::Rect bounds = content->GetBoundsInRootWindow(); base::TimeDelta timestamp; diff --git a/content/shell/browser/shell_platform_data_aura.h b/content/shell/browser/shell_platform_data_aura.h index 0a52d97..4027bc3 100644 --- a/content/shell/browser/shell_platform_data_aura.h +++ b/content/shell/browser/shell_platform_data_aura.h @@ -35,7 +35,7 @@ class ShellPlatformDataAura { void ShowWindow(); void ResizeWindow(const gfx::Size& size); - aura::WindowEventDispatcher* dispatcher() { return host_->dispatcher(); } + aura::WindowTreeHost* host() { return host_.get(); } private: scoped_ptr<aura::WindowTreeHost> host_; diff --git a/content/shell/browser/shell_views.cc b/content/shell/browser/shell_views.cc index 47aab24..5789cd6 100644 --- a/content/shell/browser/shell_views.cc +++ b/content/shell/browser/shell_views.cc @@ -512,7 +512,7 @@ void Shell::PlatformSetContents() { if (headless_) { CHECK(platform_); aura::Window* content = web_contents_->GetView()->GetNativeView(); - aura::Window* parent = platform_->dispatcher()->window(); + aura::Window* parent = platform_->host()->window(); if (!parent->Contains(content)) { parent->AddChild(content); content->Show(); diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index ba26167..5f6df5ac 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -577,7 +577,7 @@ class TimedEvents { return base::TimeDelta::FromMilliseconds(simulated_now_ + time_in_millis); } - void SendScrollEvents(WindowEventDispatcher* dispatcher, + void SendScrollEvents(ui::EventProcessor* dispatcher, float x_start, float y_start, int dx, @@ -601,7 +601,7 @@ class TimedEvents { } } - void SendScrollEvent(WindowEventDispatcher* dispatcher, + void SendScrollEvent(ui::EventProcessor* dispatcher, float x, float y, int touch_id, @@ -1030,7 +1030,8 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) { // should generate both SCROLL_BEGIN and SCROLL_UPDATE gestures. // The first movement is diagonal, to ensure that we have a free scroll, // and not a rail scroll. - tes.SendScrollEvent(dispatcher(), 111.5, 211.5, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 111.5, 211.5, kTouchId, + delegate.get()); EXPECT_3_EVENTS(delegate->events(), ui::ET_GESTURE_TAP_CANCEL, ui::ET_GESTURE_SCROLL_BEGIN, @@ -1046,13 +1047,13 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) { EXPECT_TRUE(delegate->bounding_box().IsEmpty()); // Move some more to generate a few more scroll updates. - tes.SendScrollEvent(dispatcher(), 91, 192, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 91, 192, kTouchId, delegate.get()); EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE); EXPECT_FLOAT_EQ(-20.5, delegate->scroll_x()); EXPECT_FLOAT_EQ(-19.5, delegate->scroll_y()); EXPECT_TRUE(delegate->bounding_box().IsEmpty()); - tes.SendScrollEvent(dispatcher(), 121, 196, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 121, 196, kTouchId, delegate.get()); EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE); EXPECT_EQ(30, delegate->scroll_x()); EXPECT_EQ(4, delegate->scroll_y()); @@ -1118,7 +1119,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) { // The first movement is diagonal, to ensure that we have a free scroll, // and not a rail scroll. tes.LeapForward(30); - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get()); EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE); EXPECT_GT(delegate->scroll_velocity_x(), 0); @@ -1132,7 +1133,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) { // Move some more to generate a few more scroll updates. tes.LeapForward(30); - tes.SendScrollEvent(dispatcher(), 110, 211, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 110, 211, kTouchId, delegate.get()); EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE); total_scroll.set_x(total_scroll.x() + delegate->scroll_x()); total_scroll.set_y(total_scroll.y() + delegate->scroll_y()); @@ -1142,7 +1143,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) { (int)(total_scroll.y())); tes.LeapForward(30); - tes.SendScrollEvent(dispatcher(), 140, 215, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 140, 215, kTouchId, delegate.get()); EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE); total_scroll.set_x(total_scroll.x() + delegate->scroll_x()); total_scroll.set_y(total_scroll.y() + delegate->scroll_y()); @@ -1188,7 +1189,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { delegate->bounding_box().ToString()); const int kScrollAmount = 50; - tes.SendScrollEvents(dispatcher(), kPositionX, kPositionY, + tes.SendScrollEvents(event_processor(), kPositionX, kPositionY, 1, 1, kTouchId, 1, kScrollAmount, delegate.get()); EXPECT_EQ(gfx::Point(1, 1).ToString(), delegate->scroll_begin_position().ToString()); @@ -1239,14 +1240,14 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) { // Move the touch-point horizontally enough that it is considered a // horizontal scroll. - tes.SendScrollEvent(dispatcher(), 25, 1, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 25, 1, kTouchId, delegate.get()); EXPECT_EQ(0, delegate->scroll_y()); EXPECT_EQ(1, delegate->scroll_y_ordinal()); EXPECT_EQ(20, delegate->scroll_x()); EXPECT_EQ(20, delegate->scroll_x_ordinal()); // Get a high x velocity, while still staying on the rail - tes.SendScrollEvents(dispatcher(), 1, 1, + tes.SendScrollEvents(event_processor(), 1, 1, 100, 10, kTouchId, 1, ui::GestureConfiguration::points_buffered_for_velocity(), delegate.get()); @@ -1289,7 +1290,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) { // Move the touch-point vertically enough that it is considered a // vertical scroll. - tes.SendScrollEvent(dispatcher(), 1, 25, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 1, 25, kTouchId, delegate.get()); EXPECT_EQ(20, delegate->scroll_y()); EXPECT_EQ(20, delegate->scroll_y_ordinal()); EXPECT_EQ(0, delegate->scroll_x()); @@ -1298,7 +1299,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) { EXPECT_GT(delegate->scroll_velocity_x_ordinal(), 0); // Get a high y velocity, while still staying on the rail - tes.SendScrollEvents(dispatcher(), 1, 6, + tes.SendScrollEvents(event_processor(), 1, 6, 10, 100, kTouchId, 1, ui::GestureConfiguration::points_buffered_for_velocity(), delegate.get()); @@ -1333,11 +1334,11 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) { DispatchEventUsingWindowDispatcher(&press); // Move the touch-point such that a non-rail scroll begins - tes.SendScrollEvent(dispatcher(), 20, 20, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 20, 20, kTouchId, delegate.get()); EXPECT_EQ(20, delegate->scroll_y()); EXPECT_EQ(20, delegate->scroll_x()); - tes.SendScrollEvents(dispatcher(), 1, 1, + tes.SendScrollEvents(event_processor(), 1, 1, 10, 100, kTouchId, 1, ui::GestureConfiguration::points_buffered_for_velocity(), delegate.get()); @@ -1431,7 +1432,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) { EXPECT_FALSE(delegate->tap_cancel()); // Scroll around, to cancel the long press - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get()); // Wait until the timer runs out gesture_sequence->ForceTimeout(); EXPECT_FALSE(delegate->long_press()); @@ -1571,11 +1572,11 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) { // Move the touch-point horizontally enough that it is considered a // horizontal scroll. - tes.SendScrollEvent(dispatcher(), 25, 1, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 25, 1, kTouchId, delegate.get()); EXPECT_EQ(0, delegate->scroll_y()); EXPECT_EQ(20, delegate->scroll_x()); - tes.SendScrollEvent(dispatcher(), 30, 6, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 30, 6, kTouchId, delegate.get()); EXPECT_TRUE(delegate->scroll_update()); EXPECT_EQ(5, delegate->scroll_x()); // y shouldn't change, as we're on a horizontal rail. @@ -1583,7 +1584,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) { // Send enough information that a velocity can be calculated for the gesture, // and we can break the rail - tes.SendScrollEvents(dispatcher(), 1, 1, + tes.SendScrollEvents(event_processor(), 1, 1, 6, 100, kTouchId, 1, ui::GestureConfiguration::points_buffered_for_velocity(), delegate.get()); @@ -1592,8 +1593,8 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) { EXPECT_GT(delegate->scroll_velocity_x(), 0); EXPECT_GT(delegate->scroll_velocity_y(), 0); - tes.SendScrollEvent(dispatcher(), 5, 0, kTouchId, delegate.get()); - tes.SendScrollEvent(dispatcher(), 10, 5, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 5, 0, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 10, 5, kTouchId, delegate.get()); // The rail should be broken EXPECT_TRUE(delegate->scroll_update()); @@ -1624,11 +1625,11 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) { // Move the touch-point vertically enough that it is considered a // vertical scroll. - tes.SendScrollEvent(dispatcher(), 1, 25, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 1, 25, kTouchId, delegate.get()); EXPECT_EQ(0, delegate->scroll_x()); EXPECT_EQ(20, delegate->scroll_y()); - tes.SendScrollEvent(dispatcher(), 6, 30, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 6, 30, kTouchId, delegate.get()); EXPECT_TRUE(delegate->scroll_update()); EXPECT_EQ(5, delegate->scroll_y()); // x shouldn't change, as we're on a vertical rail. @@ -1637,15 +1638,15 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) { // Send enough information that a velocity can be calculated for the gesture, // and we can break the rail - tes.SendScrollEvents(dispatcher(), 1, 6, + tes.SendScrollEvents(event_processor(), 1, 6, 100, 1, kTouchId, 1, ui::GestureConfiguration::points_buffered_for_velocity(), delegate.get()); EXPECT_GT(delegate->scroll_velocity_x(), 0); EXPECT_GT(delegate->scroll_velocity_y(), 0); - tes.SendScrollEvent(dispatcher(), 0, 5, kTouchId, delegate.get()); - tes.SendScrollEvent(dispatcher(), 5, 10, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 0, 5, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 5, 10, kTouchId, delegate.get()); // The rail should be broken EXPECT_TRUE(delegate->scroll_update()); @@ -1782,7 +1783,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { scoped_ptr<QueueTouchEventDelegate> queued_delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); const int kWindowWidth = 123; const int kWindowHeight = 45; const int kTouchId1 = 6; @@ -2079,12 +2080,12 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( EXPECT_FALSE(delegate->pinch_begin()); // Touch move triggers pinch begin. - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId1, delegate.get()); EXPECT_TRUE(delegate->pinch_begin()); EXPECT_FALSE(delegate->pinch_update()); // Touch move triggers pinch update. - tes.SendScrollEvent(dispatcher(), 160, 200, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 160, 200, kTouchId1, delegate.get()); EXPECT_FALSE(delegate->pinch_begin()); EXPECT_TRUE(delegate->pinch_update()); @@ -2095,7 +2096,7 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( DispatchEventUsingWindowDispatcher(&release); EXPECT_TRUE(delegate->pinch_end()); - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId2, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId2, delegate.get()); EXPECT_TRUE(delegate->scroll_update()); // Pinch again @@ -2110,7 +2111,7 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( DispatchEventUsingWindowDispatcher(&move2); EXPECT_TRUE(delegate->pinch_begin()); - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId1, delegate.get()); EXPECT_TRUE(delegate->pinch_update()); } @@ -2349,7 +2350,7 @@ TEST_F(GestureRecognizerTest, GestureEventOutsideRootWindowTap) { TEST_F(GestureRecognizerTest, NoTapWithPreventDefaultedRelease) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); TimedEvents tes; const int kTouchId = 2; gfx::Rect bounds(100, 200, 100, 100); @@ -2376,7 +2377,7 @@ TEST_F(GestureRecognizerTest, NoTapWithPreventDefaultedRelease) { TEST_F(GestureRecognizerTest, PinchScrollWithPreventDefaultedRelease) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); TimedEvents tes; const int kTouchId1 = 7; const int kTouchId2 = 5; @@ -2751,7 +2752,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { kTouchId2, tes.Now()); DispatchEventUsingWindowDispatcher(&press2); - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId1, delegate.get()); EXPECT_FALSE(delegate->two_finger_tap()); EXPECT_TRUE(delegate->pinch_begin()); @@ -2782,7 +2783,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { kTouchId2, tes.Now()); DispatchEventUsingWindowDispatcher(&press2); - tes.SendScrollEvent(dispatcher(), 101, 230, kTouchId2, delegate.get()); + tes.SendScrollEvent(event_processor(), 101, 230, kTouchId2, delegate.get()); EXPECT_FALSE(delegate->two_finger_tap()); EXPECT_TRUE(delegate->pinch_begin()); @@ -2815,7 +2816,7 @@ TEST_F(GestureRecognizerTest, NoTwoFingerTapWhenFirstFingerHasScrolled) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); DispatchEventUsingWindowDispatcher(&press1); - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId1, delegate.get()); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), @@ -3031,7 +3032,7 @@ TEST_F(GestureRecognizerTest, FlushAllOnHide) { TEST_F(GestureRecognizerTest, LongPressTimerStopsOnPreventDefaultedTouchMoves) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); const int kTouchId = 2; gfx::Rect bounds(100, 200, 100, 100); scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( @@ -3052,7 +3053,7 @@ TEST_F(GestureRecognizerTest, LongPressTimerStopsOnPreventDefaultedTouchMoves) { kTouchId, tes.Now()); DispatchEventUsingWindowDispatcher(&press); // Scroll around, to cancel the long press - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get()); delegate->Reset(); delegate->ReceivedAck(); @@ -3115,7 +3116,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) { // Move the touch-point enough so that it would normally be considered a // scroll. But since the touch-moves will be consumed, the scroll should not // start. - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get()); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_TRUE(delegate->tap_cancel()); @@ -3158,7 +3159,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); DispatchEventUsingWindowDispatcher(&press1); - tes.SendScrollEvent(dispatcher(), 131, 231, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 131, 231, kTouchId1, delegate.get()); // First finger touches down and moves. EXPECT_FALSE(delegate->tap()); @@ -3171,7 +3172,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.LeapForward(50)); DispatchEventUsingWindowDispatcher(&press2); - tes.SendScrollEvent(dispatcher(), 161, 231, kTouchId2, delegate.get()); + tes.SendScrollEvent(event_processor(), 161, 231, kTouchId2, delegate.get()); // PinchBegin & ScrollBegin were not sent if the touch-move events were // consumed. @@ -3189,7 +3190,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { delegate->Reset(); // Moves First finger again, no PinchUpdate & ScrollUpdate. - tes.SendScrollEvent(dispatcher(), 161, 261, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 161, 261, kTouchId1, delegate.get()); EXPECT_FALSE(delegate->pinch_update()); EXPECT_FALSE(delegate->pinch_end()); @@ -3201,7 +3202,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { delegate->Reset(); // Making a pinch gesture. - tes.SendScrollEvent(dispatcher(), 161, 251, kTouchId1, delegate.get()); + tes.SendScrollEvent(event_processor(), 161, 251, kTouchId1, delegate.get()); // If touch moves are ever consumed, we should not see PinchBegin/Update // even touch moves become not consumed. EXPECT_FALSE(delegate->scroll_begin()); @@ -3213,7 +3214,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { EXPECT_FALSE(delegate->pinch_end()); delegate->Reset(); - tes.SendScrollEvent(dispatcher(), 161, 241, kTouchId2, delegate.get()); + tes.SendScrollEvent(event_processor(), 161, 241, kTouchId2, delegate.get()); EXPECT_FALSE(delegate->scroll_begin()); EXPECT_FALSE(delegate->scroll_update()); EXPECT_FALSE(delegate->scroll_end()); @@ -3274,7 +3275,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) { // Move the touch-point enough so that it would normally be considered a // scroll. But since the touch-moves will be consumed, the scroll should not // start. - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get()); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_TRUE(delegate->tap_cancel()); @@ -3285,7 +3286,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) { // Now, stop consuming touch-move events, and move the touch-point again. delegate->set_consume_touch_move(false); - tes.SendScrollEvent(dispatcher(), 159, 259, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 159, 259, kTouchId, delegate.get()); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -3303,7 +3304,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) { delegate->set_consume_touch_move(true); // Move some more to generate a few more scroll updates. - tes.SendScrollEvent(dispatcher(), 110, 211, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 110, 211, kTouchId, delegate.get()); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -3314,7 +3315,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) { EXPECT_EQ(0, delegate->scroll_x()); EXPECT_EQ(0, delegate->scroll_y()); - tes.SendScrollEvent(dispatcher(), 140, 215, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 140, 215, kTouchId, delegate.get()); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -3655,7 +3656,7 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveCanFireTapCancel) { // Move the touch-point enough so that it would normally be considered a // scroll. But since the touch-moves will be consumed, the scroll should not // start. - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get()); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_TRUE(delegate->tap_cancel()); @@ -3784,7 +3785,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressCancelledByScroll) { EXPECT_FALSE(delegate->tap_cancel()); // Scroll around, to cancel the show press - tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); + tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get()); // Wait until the timer runs out gesture_sequence->ForceTimeout(); EXPECT_FALSE(delegate->show_press()); @@ -3833,7 +3834,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressSentOnTap) { // Test that consuming the first move touch event prevents a scroll. TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveScrollTest) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); TimedEvents tes; const int kTouchId = 7; gfx::Rect bounds(0, 0, 1000, 1000); @@ -3863,7 +3864,7 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveScrollTest) { // prevent pinching once an additional touch has been pressed. TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMovePinchTest) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); TimedEvents tes; const int kTouchId1 = 7; const int kTouchId2 = 4; @@ -3920,7 +3921,7 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMovePinchTest) { // Test that consuming the first move touch doesn't prevent a tap. TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveTapTest) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); TimedEvents tes; const int kTouchId = 7; gfx::Rect bounds(0, 0, 1000, 1000); @@ -3948,7 +3949,7 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveTapTest) { // Test that consuming the first move touch doesn't prevent a long press. TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveLongPressTest) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); TimedEvents tes; const int kWindowWidth = 123; const int kWindowHeight = 45; @@ -4041,7 +4042,7 @@ TEST_F(GestureRecognizerTest, TestExceedingSlopSlowly) { TEST_F(GestureRecognizerTest, ScrollAlternatelyConsumedTest) { scoped_ptr<QueueTouchEventDelegate> delegate( - new QueueTouchEventDelegate(dispatcher())); + new QueueTouchEventDelegate(host()->dispatcher())); TimedEvents tes; const int kWindowWidth = 3000; const int kWindowHeight = 3000; diff --git a/ui/aura/test/aura_test_base.cc b/ui/aura/test/aura_test_base.cc index b4926fb..ec7eb95 100644 --- a/ui/aura/test/aura_test_base.cc +++ b/ui/aura/test/aura_test_base.cc @@ -8,10 +8,10 @@ #include "ui/aura/test/aura_test_helper.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" #include "ui/base/ime/input_method_initializer.h" #include "ui/compositor/test/context_factories_for_test.h" #include "ui/events/event_dispatcher.h" +#include "ui/events/event_processor.h" #include "ui/events/gestures/gesture_configuration.h" namespace aura { @@ -113,7 +113,8 @@ void AuraTestBase::ParentWindow(Window* window) { } bool AuraTestBase::DispatchEventUsingWindowDispatcher(ui::Event* event) { - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(event); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(event); CHECK(!details.dispatcher_destroyed); return event->handled(); } diff --git a/ui/aura/test/aura_test_base.h b/ui/aura/test/aura_test_base.h index 5fb94e7..b9f6e7f 100644 --- a/ui/aura/test/aura_test_base.h +++ b/ui/aura/test/aura_test_base.h @@ -14,7 +14,6 @@ namespace aura { class Window; class WindowDelegate; -class WindowEventDispatcher; namespace test { // A base class for aura unit tests. @@ -42,7 +41,8 @@ class AuraTestBase : public testing::Test { bool DispatchEventUsingWindowDispatcher(ui::Event* event); Window* root_window() { return helper_->root_window(); } - WindowEventDispatcher* dispatcher() { return helper_->dispatcher(); } + WindowTreeHost* host() { return helper_->host(); } + ui::EventProcessor* event_processor() { return helper_->event_processor(); } TestScreen* test_screen() { return helper_->test_screen(); } private: diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc index 02d36e4..b300dcf 100644 --- a/ui/aura/test/aura_test_helper.cc +++ b/ui/aura/test/aura_test_helper.cc @@ -81,7 +81,7 @@ void AuraTestHelper::SetUp() { root_window()->Show(); // Ensure width != height so tests won't confuse them. - dispatcher()->host()->SetBounds(gfx::Rect(800, 600)); + host()->SetBounds(gfx::Rect(800, 600)); } void AuraTestHelper::TearDown() { diff --git a/ui/aura/test/aura_test_helper.h b/ui/aura/test/aura_test_helper.h index c472db8..ee17693 100644 --- a/ui/aura/test/aura_test_helper.h +++ b/ui/aura/test/aura_test_helper.h @@ -47,7 +47,7 @@ class AuraTestHelper { void RunAllPendingInMessageLoop(); Window* root_window() { return host_->window(); } - WindowEventDispatcher* dispatcher() { return host_->dispatcher(); } + ui::EventProcessor* event_processor() { return host_->event_processor(); } WindowTreeHost* host() { return host_.get(); } TestScreen* test_screen() { return test_screen_.get(); } diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator.cc index b1dcab5..42614f5 100644 --- a/ui/aura/test/event_generator.cc +++ b/ui/aura/test/event_generator.cc @@ -39,9 +39,8 @@ class DefaultEventGeneratorDelegate : public EventGeneratorDelegate { virtual ~DefaultEventGeneratorDelegate() {} // EventGeneratorDelegate overrides: - virtual WindowEventDispatcher* GetDispatcherAt( - const gfx::Point& point) const OVERRIDE { - return root_window_->GetHost()->dispatcher(); + virtual WindowTreeHost* GetHostAt(const gfx::Point& point) const OVERRIDE { + return root_window_->GetHost(); } virtual client::ScreenPositionClient* GetScreenPositionClient( @@ -83,7 +82,7 @@ const int kAllButtonMask = ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON; EventGenerator::EventGenerator(Window* root_window) : delegate_(new DefaultEventGeneratorDelegate(root_window)), - current_dispatcher_(delegate_->GetDispatcherAt(current_location_)), + current_host_(delegate_->GetHostAt(current_location_)), flags_(0), grab_(false), async_(false) { @@ -92,7 +91,7 @@ EventGenerator::EventGenerator(Window* root_window) EventGenerator::EventGenerator(Window* root_window, const gfx::Point& point) : delegate_(new DefaultEventGeneratorDelegate(root_window)), current_location_(point), - current_dispatcher_(delegate_->GetDispatcherAt(current_location_)), + current_host_(delegate_->GetHostAt(current_location_)), flags_(0), grab_(false), async_(false) { @@ -101,7 +100,7 @@ EventGenerator::EventGenerator(Window* root_window, const gfx::Point& point) EventGenerator::EventGenerator(Window* root_window, Window* window) : delegate_(new DefaultEventGeneratorDelegate(root_window)), current_location_(CenterOfWindow(window)), - current_dispatcher_(delegate_->GetDispatcherAt(current_location_)), + current_host_(delegate_->GetHostAt(current_location_)), flags_(0), grab_(false), async_(false) { @@ -109,7 +108,7 @@ EventGenerator::EventGenerator(Window* root_window, Window* window) EventGenerator::EventGenerator(EventGeneratorDelegate* delegate) : delegate_(delegate), - current_dispatcher_(delegate_->GetDispatcherAt(current_location_)), + current_host_(delegate_->GetHostAt(current_location_)), flags_(0), grab_(false), async_(false) { @@ -152,7 +151,7 @@ void EventGenerator::ReleaseRightButton() { void EventGenerator::SendMouseExit() { gfx::Point exit_location(current_location_); - ConvertPointToTarget(current_dispatcher_->window(), &exit_location); + ConvertPointToTarget(current_host_->window(), &exit_location); ui::MouseEvent mouseev(ui::ET_MOUSE_EXITED, exit_location, exit_location, flags_, 0); Dispatch(&mouseev); @@ -165,7 +164,7 @@ void EventGenerator::MoveMouseToInHost(const gfx::Point& point_in_host) { Dispatch(&mouseev); current_location_ = point_in_host; - current_dispatcher_->host()->ConvertPointFromHost(¤t_location_); + current_host_->ConvertPointFromHost(¤t_location_); } void EventGenerator::MoveMouseTo(const gfx::Point& point_in_screen, @@ -181,7 +180,7 @@ void EventGenerator::MoveMouseTo(const gfx::Point& point_in_screen, gfx::Point move_point = current_location_ + gfx::ToRoundedVector2d(step); if (!grab_) UpdateCurrentDispatcher(move_point); - ConvertPointToTarget(current_dispatcher_->window(), &move_point); + ConvertPointToTarget(current_host_->window(), &move_point); ui::MouseEvent mouseev(event_type, move_point, move_point, flags_, 0); Dispatch(&mouseev); } @@ -525,7 +524,7 @@ void EventGenerator::DispatchKeyEvent(bool is_press, } void EventGenerator::UpdateCurrentDispatcher(const gfx::Point& point) { - current_dispatcher_ = delegate_->GetDispatcherAt(point); + current_host_ = delegate_->GetHostAt(point); } void EventGenerator::PressButton(int flag) { @@ -574,7 +573,7 @@ void EventGenerator::ConvertPointToTarget(const aura::Window* target, gfx::Point EventGenerator::GetLocationInCurrentRoot() const { gfx::Point p(current_location_); - ConvertPointToTarget(current_dispatcher_->window(), &p); + ConvertPointToTarget(current_host_->window(), &p); return p; } @@ -608,8 +607,8 @@ void EventGenerator::DoDispatchEvent(ui::Event* event, bool async) { } pending_events_.push_back(pending_event); } else { - ui::EventDispatchDetails details = current_dispatcher_->OnEventFromSource( - event); + ui::EventDispatchDetails details = + current_host_->event_processor()->OnEventFromSource(event); CHECK(!details.dispatcher_destroyed); } } diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator.h index 97358c4..fe71f2e 100644 --- a/ui/aura/test/event_generator.h +++ b/ui/aura/test/event_generator.h @@ -21,6 +21,7 @@ class TimeDelta; namespace ui { class Event; +class EventProcessor; class KeyEvent; class MouseEvent; class ScrollEvent; @@ -29,7 +30,7 @@ class TouchEvent; namespace aura { class Window; -class WindowEventDispatcher; +class WindowTreeHost; namespace client { class ScreenPositionClient; @@ -46,9 +47,8 @@ class EventGeneratorDelegate { public: virtual ~EventGeneratorDelegate() {} - // Returns a root window for given point. - virtual WindowEventDispatcher* GetDispatcherAt( - const gfx::Point& point) const = 0; + // Returns the host for given point. + virtual WindowTreeHost* GetHostAt(const gfx::Point& point) const = 0; // Returns the screen position client that determines the // coordinates used in EventGenerator. EventGenerator uses @@ -310,8 +310,8 @@ class EventGenerator { // Dispatch the event to the WindowEventDispatcher. void Dispatch(ui::Event* event); - void set_current_dispatcher(WindowEventDispatcher* dispatcher) { - current_dispatcher_ = dispatcher; + void set_current_host(WindowTreeHost* host) { + current_host_ = host; } private: @@ -337,7 +337,7 @@ class EventGenerator { scoped_ptr<EventGeneratorDelegate> delegate_; gfx::Point current_location_; - WindowEventDispatcher* current_dispatcher_; + WindowTreeHost* current_host_; int flags_; bool grab_; std::list<ui::Event*> pending_events_; diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc index 67866e9..b2cffaf 100644 --- a/ui/aura/window_event_dispatcher_unittest.cc +++ b/ui/aura/window_event_dispatcher_unittest.cc @@ -140,7 +140,7 @@ TEST_F(WindowEventDispatcherTest, RepostEvent) { ui::MouseEvent event( ui::ET_MOUSE_PRESSED, point, point, ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); - dispatcher()->RepostEvent(event); + host()->dispatcher()->RepostEvent(event); RunAllPendingInMessageLoop(); EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown()); } @@ -592,7 +592,7 @@ TEST_F(WindowEventDispatcherTest, RepostTargetsCaptureWindow) { const ui::MouseEvent press_event( ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); - dispatcher()->RepostEvent(press_event); + host()->dispatcher()->RepostEvent(press_event); RunAllPendingInMessageLoop(); // Necessitated by RepostEvent(). // Mouse moves/enters may be generated. We only care about a pressed. EXPECT_TRUE(EventTypesToString(recorder->events()).find("MOUSE_PRESSED") != @@ -613,7 +613,7 @@ TEST_F(WindowEventDispatcherTest, MouseMovesHeld) { // Discard MOUSE_ENTER. filter->Reset(); - dispatcher()->HoldPointerMoves(); + host()->dispatcher()->HoldPointerMoves(); // Check that we don't immediately dispatch the MOUSE_DRAGGED event. ui::MouseEvent mouse_dragged_event(ui::ET_MOUSE_DRAGGED, gfx::Point(0, 0), @@ -644,7 +644,7 @@ TEST_F(WindowEventDispatcherTest, MouseMovesHeld) { // Check that on ReleasePointerMoves, held events are not dispatched // immediately, but posted instead. DispatchEventUsingWindowDispatcher(&mouse_dragged_event); - dispatcher()->ReleasePointerMoves(); + host()->dispatcher()->ReleasePointerMoves(); EXPECT_TRUE(filter->events().empty()); RunAllPendingInMessageLoop(); EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); @@ -652,9 +652,9 @@ TEST_F(WindowEventDispatcherTest, MouseMovesHeld) { // However if another message comes in before the dispatch of the posted // event, check that the posted event is dispatched before this new event. - dispatcher()->HoldPointerMoves(); + host()->dispatcher()->HoldPointerMoves(); DispatchEventUsingWindowDispatcher(&mouse_dragged_event); - dispatcher()->ReleasePointerMoves(); + host()->dispatcher()->ReleasePointerMoves(); DispatchEventUsingWindowDispatcher(&mouse_pressed_event); EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED", EventTypesToString(filter->events())); @@ -664,9 +664,9 @@ TEST_F(WindowEventDispatcherTest, MouseMovesHeld) { // Check that if the other message is another MOUSE_DRAGGED, we still coalesce // them. - dispatcher()->HoldPointerMoves(); + host()->dispatcher()->HoldPointerMoves(); DispatchEventUsingWindowDispatcher(&mouse_dragged_event); - dispatcher()->ReleasePointerMoves(); + host()->dispatcher()->ReleasePointerMoves(); DispatchEventUsingWindowDispatcher(&mouse_dragged_event2); EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); filter->Reset(); @@ -677,14 +677,14 @@ TEST_F(WindowEventDispatcherTest, MouseMovesHeld) { // while holding pointer moves. ui::MouseEvent mouse_dragged_event3(ui::ET_MOUSE_DRAGGED, gfx::Point(28, 28), gfx::Point(28, 28), 0, 0); - dispatcher()->HoldPointerMoves(); + host()->dispatcher()->HoldPointerMoves(); DispatchEventUsingWindowDispatcher(&mouse_dragged_event); DispatchEventUsingWindowDispatcher(&mouse_dragged_event2); window->SetBounds(gfx::Rect(15, 15, 80, 80)); DispatchEventUsingWindowDispatcher(&mouse_dragged_event3); RunAllPendingInMessageLoop(); EXPECT_TRUE(filter->events().empty()); - dispatcher()->ReleasePointerMoves(); + host()->dispatcher()->ReleasePointerMoves(); RunAllPendingInMessageLoop(); EXPECT_EQ("MOUSE_MOVED", EventTypesToString(filter->events())); EXPECT_EQ(gfx::Point(13, 13), filter->mouse_location(0)); @@ -709,7 +709,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) { filter->WaitUntilReceivedEvent(ui::ET_GESTURE_SHOW_PRESS); filter->Reset(); - dispatcher()->HoldPointerMoves(); + host()->dispatcher()->HoldPointerMoves(); // Check that we don't immediately dispatch the TOUCH_MOVED event. ui::TouchEvent touch_moved_event(ui::ET_TOUCH_MOVED, touch_location, @@ -720,7 +720,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) { // Check that on ReleasePointerMoves, held events are not dispatched // immediately, but posted instead. DispatchEventUsingWindowDispatcher(&touch_moved_event); - dispatcher()->ReleasePointerMoves(); + host()->dispatcher()->ReleasePointerMoves(); EXPECT_TRUE(filter->events().empty()); RunAllPendingInMessageLoop(); @@ -732,13 +732,13 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) { ui::TouchEvent touch_released_event(ui::ET_TOUCH_RELEASED, touch_location, 0, base::TimeDelta()); filter->Reset(); - dispatcher()->HoldPointerMoves(); + host()->dispatcher()->HoldPointerMoves(); DispatchEventUsingWindowDispatcher(&touch_moved_event); DispatchEventUsingWindowDispatcher(&touch_released_event); EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_TAP_CANCEL GESTURE_END", EventTypesToString(filter->events())); filter->Reset(); - dispatcher()->ReleasePointerMoves(); + host()->dispatcher()->ReleasePointerMoves(); RunAllPendingInMessageLoop(); EXPECT_TRUE(filter->events().empty()); } @@ -779,7 +779,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeldOnScroll) { EventFilterRecorder* filter = new EventFilterRecorder; root_window()->SetEventFilter(filter); test::TestWindowDelegate delegate; - HoldPointerOnScrollHandler handler(dispatcher(), filter); + HoldPointerOnScrollHandler handler(host()->dispatcher(), filter); scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( &delegate, 1, gfx::Rect(50, 50, 100, 100), root_window())); window->AddPreTargetHandler(&handler); @@ -861,7 +861,7 @@ TEST_F(WindowEventDispatcherTest, DispatchMouseExitWhenCursorHidden) { filter->Reset(); // Hide the cursor and verify a mouse exit was dispatched. - dispatcher()->host()->OnCursorVisibilityChanged(false); + host()->OnCursorVisibilityChanged(false); EXPECT_FALSE(filter->events().empty()); EXPECT_EQ("MOUSE_EXITED", EventTypesToString(filter->events())); @@ -1096,7 +1096,7 @@ TEST_F(WindowEventDispatcherTest, RepostTapdownGestureTest) { ui::EventTimeForNow(), details, 0); - dispatcher()->RepostEvent(event); + host()->dispatcher()->RepostEvent(event); RunAllPendingInMessageLoop(); // TODO(rbyers): Currently disabled - crbug.com/170987 EXPECT_FALSE(EventTypesToString(filter->events()).find("GESTURE_TAP_DOWN") != @@ -1250,14 +1250,14 @@ TEST_F(WindowEventDispatcherTest, DeleteWindowDuringMouseMovedDispatch) { new OnMouseExitDeletingEventFilter(); w1->SetEventFilter(w1_filter); w1->SetBounds(gfx::Rect(20, 20, 60, 60)); - EXPECT_EQ(NULL, dispatcher()->mouse_moved_handler()); + EXPECT_EQ(NULL, host()->dispatcher()->mouse_moved_handler()); test::EventGenerator generator(root_window(), w1.get()); // Move mouse over window 1 to set it as the |mouse_moved_handler_| for the // root window. generator.MoveMouseTo(51, 51); - EXPECT_EQ(w1.get(), dispatcher()->mouse_moved_handler()); + EXPECT_EQ(w1.get(), host()->dispatcher()->mouse_moved_handler()); // Create window 2 under the mouse cursor and stack it above window 1. Window* w2 = CreateNormalWindow(2, root_window(), NULL); @@ -1273,7 +1273,7 @@ TEST_F(WindowEventDispatcherTest, DeleteWindowDuringMouseMovedDispatch) { // that was targeted to window 2 should be dropped since window 2 is // destroyed. This test passes if no crash happens. generator.MoveMouseTo(52, 52); - EXPECT_EQ(NULL, dispatcher()->mouse_moved_handler()); + EXPECT_EQ(NULL, host()->dispatcher()->mouse_moved_handler()); // Check events received by window 1. EXPECT_EQ("MOUSE_ENTERED MOUSE_MOVED MOUSE_EXITED", @@ -1626,7 +1626,7 @@ class WindowEventDispatcherTestWithMessageLoop gfx::Point(10, 10), ui::EF_NONE, ui::EF_NONE); message_loop()->PostTask(FROM_HERE, base::Bind(&WindowEventDispatcher::RepostEvent, - base::Unretained(dispatcher()), + base::Unretained(host()->dispatcher()), mouse)); message_loop()->PostTask(FROM_HERE, message_loop()->QuitClosure()); @@ -1726,7 +1726,7 @@ TEST_F(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) { EventFilterRecorder* filter = new EventFilterRecorder; root_window()->SetEventFilter(filter); test::TestWindowDelegate delegate; - HoldPointerOnScrollHandler handler(dispatcher(), filter); + HoldPointerOnScrollHandler handler(host()->dispatcher(), filter); scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( &delegate, 1, gfx::Rect(50, 50, 100, 100), root_window())); window->AddPreTargetHandler(&handler); @@ -1831,7 +1831,7 @@ TEST_F(WindowEventDispatcherTest, HostCancelModeWithFocusedWindowOutside) { EXPECT_FALSE(root_window()->Contains(focused.get())); EXPECT_EQ(focused.get(), client::GetFocusClient(root_window())->GetFocusedWindow()); - dispatcher()->DispatchCancelModeEvent(); + host()->dispatcher()->DispatchCancelModeEvent(); EXPECT_EQ(focused.get(), client::GetFocusClient(root_window())->GetFocusedWindow()); } @@ -1931,7 +1931,8 @@ TEST_F(WindowEventDispatcherTest, MAYBE_NestedEventDispatchTargetMoved) { // Dispatch an event to |first|. ui::MouseEvent move(ui::ET_MOUSE_MOVED, first->bounds().CenterPoint(), first->bounds().CenterPoint(), ui::EF_NONE, ui::EF_NONE); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&move); + ui::EventDispatchDetails details = + host()->dispatcher()->OnEventFromSource(&move); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_TRUE(details.target_destroyed); EXPECT_EQ(first.get(), move.target()); diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc index 93c624b..ad286c8 100644 --- a/ui/aura/window_tree_host.cc +++ b/ui/aura/window_tree_host.cc @@ -125,6 +125,10 @@ void WindowTreeHost::RemoveObserver(WindowTreeHostObserver* observer) { observers_.RemoveObserver(observer); } +ui::EventProcessor* WindowTreeHost::event_processor() { + return dispatcher(); +} + void WindowTreeHost::SetRootWindowTransformer( scoped_ptr<RootWindowTransformer> transformer) { transformer_ = transformer.Pass(); diff --git a/ui/aura/window_tree_host.h b/ui/aura/window_tree_host.h index dc2b7c5..3986453 100644 --- a/ui/aura/window_tree_host.h +++ b/ui/aura/window_tree_host.h @@ -23,6 +23,7 @@ class Transform; namespace ui { class Compositor; +class EventProcessor; class ViewProp; } @@ -49,11 +50,13 @@ class AURA_EXPORT WindowTreeHost { void InitCompositor(); + void AddObserver(WindowTreeHostObserver* observer); + void RemoveObserver(WindowTreeHostObserver* observer); + Window* window() { return window_; } const Window* window() const { return window_; } - void AddObserver(WindowTreeHostObserver* observer); - void RemoveObserver(WindowTreeHostObserver* observer); + ui::EventProcessor* event_processor(); WindowEventDispatcher* dispatcher() { return const_cast<WindowEventDispatcher*>( diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index d0e0bd2..1abac6e 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -370,11 +370,11 @@ TEST_F(WindowTest, MoveCursorToWithTransformRootWindow) { transform.Translate(100.0, 100.0); transform.Rotate(90.0); transform.Scale(2.0, 5.0); - dispatcher()->host()->SetTransform(transform); - dispatcher()->host()->MoveCursorTo(gfx::Point(10, 10)); + host()->SetTransform(transform); + host()->MoveCursorTo(gfx::Point(10, 10)); #if !defined(OS_WIN) gfx::Point mouse_location; - EXPECT_TRUE(dispatcher()->host()->QueryMouseLocation(&mouse_location)); + EXPECT_TRUE(host()->QueryMouseLocation(&mouse_location)); // TODO(yoshiki): fix this to build on Windows. See crbug.com/133413.OD EXPECT_EQ("50,120", mouse_location.ToString()); #endif @@ -451,7 +451,7 @@ TEST_F(WindowTest, MoveCursorToWithComplexTransform) { transform.Translate(10.0, 20.0); transform.Rotate(10.0); transform.Scale(0.3f, 0.5f); - dispatcher()->host()->SetTransform(root_transform); + host()->SetTransform(root_transform); w1->SetTransform(transform); w11->SetTransform(transform); w111->SetTransform(transform); @@ -462,7 +462,7 @@ TEST_F(WindowTest, MoveCursorToWithComplexTransform) { #if !defined(OS_WIN) // TODO(yoshiki): fix this to build on Windows. See crbug.com/133413. gfx::Point mouse_location; - EXPECT_TRUE(dispatcher()->host()->QueryMouseLocation(&mouse_location)); + EXPECT_TRUE(host()->QueryMouseLocation(&mouse_location)); EXPECT_EQ("169,80", mouse_location.ToString()); #endif EXPECT_EQ("20,53", @@ -1068,7 +1068,7 @@ TEST_F(WindowTest, ReleaseCaptureOnDestroy) { window.reset(); // Make sure the root window doesn't reference the window anymore. - EXPECT_EQ(NULL, dispatcher()->mouse_pressed_handler()); + EXPECT_EQ(NULL, host()->dispatcher()->mouse_pressed_handler()); EXPECT_EQ(NULL, aura::client::GetCaptureWindow(root_window())); } @@ -1485,7 +1485,7 @@ TEST_F(WindowTest, IgnoreEventsTest) { // Tests transformation on the root window. TEST_F(WindowTest, Transform) { - gfx::Size size = dispatcher()->host()->GetBounds().size(); + gfx::Size size = host()->GetBounds().size(); EXPECT_EQ(gfx::Rect(size), gfx::Screen::GetScreenFor(root_window())->GetDisplayNearestPoint( gfx::Point()).bounds()); @@ -1494,7 +1494,7 @@ TEST_F(WindowTest, Transform) { gfx::Transform transform; transform.Translate(size.height(), 0); transform.Rotate(90.0); - dispatcher()->host()->SetTransform(transform); + host()->SetTransform(transform); // The size should be the transformed size. gfx::Size transformed_size(size.height(), size.width()); @@ -1506,12 +1506,11 @@ TEST_F(WindowTest, Transform) { gfx::Point()).bounds().ToString()); // Host size shouldn't change. - EXPECT_EQ(size.ToString(), - dispatcher()->host()->GetBounds().size().ToString()); + EXPECT_EQ(size.ToString(), host()->GetBounds().size().ToString()); } TEST_F(WindowTest, TransformGesture) { - gfx::Size size = dispatcher()->host()->GetBounds().size(); + gfx::Size size = host()->GetBounds().size(); scoped_ptr<GestureTrackPositionDelegate> delegate( new GestureTrackPositionDelegate); @@ -1522,7 +1521,7 @@ TEST_F(WindowTest, TransformGesture) { gfx::Transform transform; transform.Translate(size.height(), 0.0); transform.Rotate(90.0); - dispatcher()->host()->SetTransform(transform); + host()->SetTransform(transform); ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10), 0, getTime()); @@ -2017,7 +2016,7 @@ TEST_F(WindowTest, VisibilityClientIsVisible) { // Tests mouse events on window change. TEST_F(WindowTest, MouseEventsOnWindowChange) { - gfx::Size size = dispatcher()->host()->GetBounds().size(); + gfx::Size size = host()->GetBounds().size(); EventGenerator generator(root_window()); generator.MoveMouseTo(50, 50); diff --git a/ui/snapshot/snapshot_aura_unittest.cc b/ui/snapshot/snapshot_aura_unittest.cc index 257f854..b000ad1 100644 --- a/ui/snapshot/snapshot_aura_unittest.cc +++ b/ui/snapshot/snapshot_aura_unittest.cc @@ -107,12 +107,11 @@ class SnapshotAuraTest : public testing::Test { protected: aura::Window* test_window() { return test_window_.get(); } aura::Window* root_window() { return helper_->root_window(); } - aura::WindowEventDispatcher* dispatcher() { return helper_->dispatcher(); } aura::TestScreen* test_screen() { return helper_->test_screen(); } void WaitForDraw() { - dispatcher()->host()->compositor()->ScheduleDraw(); - ui::DrawWaiterForTest::Wait(dispatcher()->host()->compositor()); + helper_->host()->compositor()->ScheduleDraw(); + ui::DrawWaiterForTest::Wait(helper_->host()->compositor()); } void SetupTestWindow(const gfx::Rect& window_bounds) { diff --git a/ui/views/corewm/capture_controller_unittest.cc b/ui/views/corewm/capture_controller_unittest.cc index 9f53768..5258614 100644 --- a/ui/views/corewm/capture_controller_unittest.cc +++ b/ui/views/corewm/capture_controller_unittest.cc @@ -100,7 +100,7 @@ TEST_F(CaptureControllerTest, ResetMouseEventHandlerOnCapture) { ui::MouseEvent mouse_pressed_event(ui::ET_MOUSE_PRESSED, gfx::Point(5, 5), gfx::Point(5, 5), 0, 0); DispatchEventUsingWindowDispatcher(&mouse_pressed_event); - EXPECT_EQ(w1.get(), dispatcher()->mouse_pressed_handler()); + EXPECT_EQ(w1.get(), host()->dispatcher()->mouse_pressed_handler()); // Build a window in the second WindowEventDispatcher. scoped_ptr<aura::Window> w2( @@ -109,7 +109,7 @@ TEST_F(CaptureControllerTest, ResetMouseEventHandlerOnCapture) { // The act of having the second window take capture should clear out mouse // pressed handler in the first WindowEventDispatcher. w2->SetCapture(); - EXPECT_EQ(NULL, dispatcher()->mouse_pressed_handler()); + EXPECT_EQ(NULL, host()->dispatcher()->mouse_pressed_handler()); } // Makes sure that when one window gets capture, it forces the release on the diff --git a/ui/views/corewm/input_method_event_filter.cc b/ui/views/corewm/input_method_event_filter.cc index cd7943c..56b1940 100644 --- a/ui/views/corewm/input_method_event_filter.cc +++ b/ui/views/corewm/input_method_event_filter.cc @@ -9,6 +9,7 @@ #include "ui/base/ime/input_method.h" #include "ui/base/ime/input_method_factory.h" #include "ui/events/event.h" +#include "ui/events/event_processor.h" namespace views { namespace corewm { @@ -47,7 +48,7 @@ void InputMethodEventFilter::OnKeyEvent(ui::KeyEvent* event) { // If the focused window is changed, all requests to IME will be // discarded so it's safe to update the target_dispatcher_ here. aura::Window* target = static_cast<aura::Window*>(event->target()); - target_dispatcher_ = target->GetRootWindow()->GetHost()->dispatcher(); + target_dispatcher_ = target->GetRootWindow()->GetHost()->event_processor(); DCHECK(target_dispatcher_); if (input_method_->DispatchKeyEvent(*event)) event->StopPropagation(); diff --git a/ui/views/corewm/input_method_event_filter.h b/ui/views/corewm/input_method_event_filter.h index cb76c1f..8327bf1 100644 --- a/ui/views/corewm/input_method_event_filter.h +++ b/ui/views/corewm/input_method_event_filter.h @@ -8,16 +8,13 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" -#include "ui/aura/window.h" #include "ui/base/ime/input_method_delegate.h" #include "ui/events/event_handler.h" +#include "ui/gfx/native_widget_types.h" #include "ui/views/views_export.h" -namespace aura { -class WindowEventDispatcher; -} - namespace ui { +class EventProcessor; class InputMethod; } @@ -47,7 +44,7 @@ class VIEWS_EXPORT InputMethodEventFilter scoped_ptr<ui::InputMethod> input_method_; // The target dispatcher that will receive translated key events from the IME. - aura::WindowEventDispatcher* target_dispatcher_; + ui::EventProcessor* target_dispatcher_; DISALLOW_COPY_AND_ASSIGN(InputMethodEventFilter); }; diff --git a/ui/views/corewm/input_method_event_filter_unittest.cc b/ui/views/corewm/input_method_event_filter_unittest.cc index 32995ab..78abb75 100644 --- a/ui/views/corewm/input_method_event_filter_unittest.cc +++ b/ui/views/corewm/input_method_event_filter_unittest.cc @@ -32,7 +32,7 @@ TEST_F(InputMethodEventFilterTest, TestInputMethodProperty) { root_window()->SetEventFilter(root_filter); InputMethodEventFilter input_method_event_filter( - dispatcher()->host()->GetAcceleratedWidget()); + host()->GetAcceleratedWidget()); root_filter->AddHandler(&input_method_event_filter); // Tests if InputMethodEventFilter adds a window property on its @@ -51,7 +51,7 @@ TEST_F(InputMethodEventFilterTest, TestInputMethodKeyEventPropagation) { // Add the InputMethodEventFilter before the TestEventFilter. InputMethodEventFilter input_method_event_filter( - dispatcher()->host()->GetAcceleratedWidget()); + host()->GetAcceleratedWidget()); root_filter->AddHandler(&input_method_event_filter); // Add TestEventFilter to the RootWindow. diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc index ff4eaa1..26a0f07 100644 --- a/ui/views/test/views_test_base.cc +++ b/ui/views/test/views_test_base.cc @@ -71,6 +71,14 @@ Widget::InitParams ViewsTestBase::CreateParams( return params; } +ui::EventProcessor* ViewsTestBase::event_processor() { + return aura_test_helper_->event_processor(); +} + +aura::WindowTreeHost* ViewsTestBase::host() { + return aura_test_helper_->host(); +} + gfx::NativeView ViewsTestBase::GetContext() { return aura_test_helper_->root_window(); } diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h index d7423952..dd08f4a 100644 --- a/ui/views/test/views_test_base.h +++ b/ui/views/test/views_test_base.h @@ -14,7 +14,12 @@ #include "ui/base/win/scoped_ole_initializer.h" #endif +namespace ui { +class EventProcessor; +} + namespace aura { +class WindowTreeHost; namespace test { class AuraTestHelper; } @@ -48,6 +53,9 @@ class ViewsTestBase : public testing::Test { base::MessageLoopForUI* message_loop() { return &message_loop_; } + ui::EventProcessor* event_processor(); + aura::WindowTreeHost* host(); + // Returns a context view. In aura builds, this will be the // RootWindow. Everywhere else, NULL. gfx::NativeView GetContext(); diff --git a/ui/views/widget/native_widget_aura_unittest.cc b/ui/views/widget/native_widget_aura_unittest.cc index e4c6670..0947bda 100644 --- a/ui/views/widget/native_widget_aura_unittest.cc +++ b/ui/views/widget/native_widget_aura_unittest.cc @@ -40,14 +40,11 @@ class NativeWidgetAuraTest : public ViewsTestBase { // testing::Test overrides: virtual void SetUp() OVERRIDE { ViewsTestBase::SetUp(); - dispatcher()->host()->SetBounds(gfx::Rect(640, 480)); + host()->SetBounds(gfx::Rect(640, 480)); } protected: aura::Window* root_window() { return GetContext(); } - aura::WindowEventDispatcher* dispatcher() { - return root_window()->GetHost()->dispatcher(); - } private: DISALLOW_COPY_AND_ASSIGN(NativeWidgetAuraTest); @@ -253,7 +250,8 @@ TEST_F(NativeWidgetAuraTest, DontCaptureOnGesture) { ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(41, 51), 1, base::TimeDelta()); - ui::EventDispatchDetails details = dispatcher()->OnEventFromSource(&press); + ui::EventDispatchDetails details = + event_processor()->OnEventFromSource(&press); ASSERT_FALSE(details.dispatcher_destroyed); // Both views should get the press. EXPECT_TRUE(view->got_gesture_event()); @@ -267,7 +265,7 @@ TEST_F(NativeWidgetAuraTest, DontCaptureOnGesture) { // the press. ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(250, 251), 1, base::TimeDelta()); - details = dispatcher()->OnEventFromSource(&release); + details = event_processor()->OnEventFromSource(&release); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_TRUE(view->got_gesture_event()); EXPECT_FALSE(child->got_gesture_event()); diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index 4d33b2b..d9b6b42 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc @@ -17,8 +17,9 @@ #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" #include "ui/base/hit_test.h" +#include "ui/events/event_processor.h" #include "ui/events/event_utils.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/point.h" @@ -1289,8 +1290,8 @@ void GenerateMouseEvents(Widget* widget, ui::EventType last_event_type) { const gfx::Rect screen_bounds(widget->GetWindowBoundsInScreen()); ui::MouseEvent move_event(ui::ET_MOUSE_MOVED, screen_bounds.CenterPoint(), screen_bounds.CenterPoint(), 0, 0); - aura::WindowEventDispatcher* dispatcher = - widget->GetNativeWindow()->GetHost()->dispatcher(); + ui::EventProcessor* dispatcher = + widget->GetNativeWindow()->GetHost()->event_processor(); ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move_event); if (last_event_type == ui::ET_MOUSE_ENTERED || details.dispatcher_destroyed) return; @@ -2058,7 +2059,7 @@ TEST_F(WidgetTest, WindowMouseModalityTest) { ui::EF_NONE, ui::EF_NONE); ui::EventDispatchDetails details = top_level_widget.GetNativeView()-> - GetHost()->dispatcher()->OnEventFromSource(&move_main); + GetHost()->event_processor()->OnEventFromSource(&move_main); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(1, widget_view->GetEventCount(ui::ET_MOUSE_ENTERED)); @@ -2085,7 +2086,7 @@ TEST_F(WidgetTest, WindowMouseModalityTest) { cursor_location_dialog, ui::EF_NONE, ui::EF_NONE); - details = top_level_widget.GetNativeView()->GetHost()->dispatcher()-> + details = top_level_widget.GetNativeView()->GetHost()->event_processor()-> OnEventFromSource(&mouse_down_dialog); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(1, dialog_widget_view->GetEventCount(ui::ET_MOUSE_PRESSED)); @@ -2098,7 +2099,7 @@ TEST_F(WidgetTest, WindowMouseModalityTest) { cursor_location_main2, ui::EF_NONE, ui::EF_NONE); - details = top_level_widget.GetNativeView()->GetHost()->dispatcher()-> + details = top_level_widget.GetNativeView()->GetHost()->event_processor()-> OnEventFromSource(&mouse_down_main); ASSERT_FALSE(details.dispatcher_destroyed); EXPECT_EQ(0, widget_view->GetEventCount(ui::ET_MOUSE_MOVED)); diff --git a/ui/wm/test/wm_test_helper.cc b/ui/wm/test/wm_test_helper.cc index a1d7c3c..bae2aca 100644 --- a/ui/wm/test/wm_test_helper.cc +++ b/ui/wm/test/wm_test_helper.cc @@ -8,6 +8,7 @@ #include "ui/aura/client/default_capture_client.h" #include "ui/aura/env.h" #include "ui/aura/test/test_focus_client.h" +#include "ui/aura/window.h" #include "ui/views/corewm/compound_event_filter.h" #include "ui/views/corewm/input_method_event_filter.h" |