Skip to content

Commit

Permalink
Remove window/host accessors from WindowEventDispatcher. Include-What…
Browse files Browse the repository at this point in the history
…-You-Use for WindowTreeHost.

TBR=sky@chromium.org
http://crbug.com/308843

Review URL: https://codereview.chromium.org/196383014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258401 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ben@chromium.org committed Mar 20, 2014
1 parent a72ef03 commit 7a60cd3
Show file tree
Hide file tree
Showing 78 changed files with 170 additions and 144 deletions.
5 changes: 3 additions & 2 deletions ash/accelerators/key_hold_detector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

#include "ash/shell.h"
#include "base/message_loop/message_loop.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tracker.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event_dispatcher.h"
#include "ui/events/event_processor.h"

namespace ash {
namespace {
Expand All @@ -27,7 +28,7 @@ void DispatchPressedEvent(XEvent native_event,
ui::KeyEvent event(&native_event, false);
event.set_flags(event.flags() | ui::EF_IS_SYNTHESIZED);
ui::EventDispatchDetails result ALLOW_UNUSED =
target->GetHost()->dispatcher()->OnEventFromSource(&event);
target->GetHost()->event_processor()->OnEventFromSource(&event);
}

void PostPressedEvent(ui::KeyEvent* event) {
Expand Down
7 changes: 4 additions & 3 deletions ash/autoclick/autoclick_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
#include "ash/wm/coordinate_conversion.h"
#include "base/timer/timer.h"
#include "ui/aura/env.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_handler.h"
#include "ui/events/event_processor.h"
#include "ui/gfx/point.h"
#include "ui/gfx/vector2d.h"

Expand Down Expand Up @@ -201,9 +202,9 @@ void AutoclickControllerImpl::DoAutoclick() {
ui::EF_LEFT_MOUSE_BUTTON);

ui::EventDispatchDetails details =
host->dispatcher()->OnEventFromSource(&press_event);
host->event_processor()->OnEventFromSource(&press_event);
if (!details.dispatcher_destroyed)
details = host->dispatcher()->OnEventFromSource(&release_event);
details = host->event_processor()->OnEventFromSource(&release_event);
if (details.dispatcher_destroyed)
return;
}
Expand Down
2 changes: 1 addition & 1 deletion ash/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "ash/shell.h"
#include "cc/debug/layer_tree_debug_state.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/compositor/compositor.h"

namespace ash {
Expand Down
2 changes: 1 addition & 1 deletion ash/display/display_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "ui/aura/client/focus_client.h"
#include "ui/aura/env.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tracker.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/display/display_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include "base/strings/stringprintf.h"
#include "ui/aura/env.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_observer.h"
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/display_observer.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/display/screen_position_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "ash/test/shell_test_api.h"
#include "ui/aura/env.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/layout.h"
#include "ui/gfx/screen.h"

Expand Down
3 changes: 2 additions & 1 deletion ash/drag_drop/drag_drop_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "ui/aura/client/capture_client.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/dragdrop/drag_drop_types.h"
Expand Down Expand Up @@ -738,7 +739,7 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) {
ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, mouse_move_location,
mouse_move_location, 0, 0);
ui::EventDispatchDetails details = Shell::GetPrimaryRootWindow()->
GetHost()->dispatcher()->OnEventFromSource(&mouse_move);
GetHost()->event_processor()->OnEventFromSource(&mouse_move);
ASSERT_FALSE(details.dispatcher_destroyed);
}

Expand Down
2 changes: 1 addition & 1 deletion ash/magnifier/magnification_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/root_window_transformer.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_property.h"
#include "ui/aura/window_tree_host.h"
#include "ui/compositor/dip_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/magnifier/magnification_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/screen.h"

Expand Down
3 changes: 2 additions & 1 deletion ash/magnifier/partial_magnification_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_property.h"
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/screen.h"
#include "ui/compositor/layer.h"
#include "ui/views/layout/fill_layout.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/shell/content_client/shell_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "net/base/net_module.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/compositor/compositor.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/shell/window_watcher_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "ash/shell/shell_delegate_impl.h"
#include "ash/system/user/login_status.h"
#include "ash/test/ash_test_base.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"

namespace ash {

Expand Down
5 changes: 3 additions & 2 deletions ash/sticky_keys/sticky_keys_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
#include "base/basictypes.h"
#include "base/debug/stack_trace.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tracker.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event.h"
#include "ui/events/event_processor.h"
#include "ui/events/keycodes/keyboard_code_conversion.h"

namespace ash {
Expand Down Expand Up @@ -86,7 +87,7 @@ void StickyKeysHandlerDelegateImpl::DispatchEvent(ui::Event* event,
aura::Window* target) {
DCHECK(target);
ui::EventDispatchDetails details =
target->GetHost()->dispatcher()->OnEventFromSource(event);
target->GetHost()->event_processor()->OnEventFromSource(event);
if (details.dispatcher_destroyed)
return;
}
Expand Down
5 changes: 3 additions & 2 deletions ash/sticky_keys/sticky_keys_overlay_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#include "ash/sticky_keys/sticky_keys_controller.h"
#include "ash/test/ash_test_base.h"
#include "base/memory/scoped_ptr.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event.h"
#include "ui/events/event_processor.h"

namespace ash {

Expand Down Expand Up @@ -41,7 +42,7 @@ class StickyKeysOverlayTest : public test::AshTestBase {
dispatcher.set_target(Shell::GetInstance()->GetPrimaryRootWindow());

ui::EventDispatchDetails details = Shell::GetPrimaryRootWindow()->
GetHost()->dispatcher()->OnEventFromSource(&event);
GetHost()->event_processor()->OnEventFromSource(&event);
CHECK(!details.dispatcher_destroyed);
}

Expand Down
2 changes: 1 addition & 1 deletion ash/test/ash_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/input_method_initializer.h"
#include "ui/events/gestures/gesture_configuration.h"
#include "ui/gfx/display.h"
Expand Down
4 changes: 2 additions & 2 deletions ash/test/ui_controls_factory_ash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/test/ui_controls_factory_aura.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_property.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/test/ui_controls.h"
#include "ui/base/test/ui_controls_aura.h"
#include "ui/gfx/screen.h"
Expand All @@ -35,7 +35,7 @@ UIControlsAura* GetUIControlsForRootWindow(aura::Window* root_window) {
root_window->GetProperty(kUIControlsKey);
if (!native_ui_control) {
native_ui_control =
aura::test::CreateUIControlsAura(root_window->GetHost()->dispatcher());
aura::test::CreateUIControlsAura(root_window->GetHost());
// Pass the ownership to the |root_window|.
root_window->SetProperty(kUIControlsKey, native_ui_control);
}
Expand Down
1 change: 1 addition & 0 deletions ash/wm/ash_native_cursor_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "base/logging.h"
#include "ui/aura/env.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/cursor/cursor.h"

namespace ash {
Expand Down
2 changes: 1 addition & 1 deletion ash/wm/ash_native_cursor_manager_interactive_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "base/path_service.h"
#include "base/run_loop.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/test/ui_controls.h"
#include "ui/base/ui_base_paths.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/wm/boot_splash_screen_chromeos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/x/x11_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_type.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/wm/lock_state_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/timer/timer.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/views/controls/menu/menu_controller.h"
Expand Down
1 change: 1 addition & 0 deletions ash/wm/toplevel_window_event_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "ui/aura/window_delegate.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_observer.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/hit_test.h"
#include "ui/base/ui_base_types.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_plugin_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#if defined(OS_WIN)
#include "content/public/browser/web_contents_view.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

using content::BrowserThread;
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/extensions/api/input/input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#if defined(USE_ASH)
#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ui/aura/window_tree_host.h"
#include "ui/keyboard/keyboard_util.h"
#endif

Expand Down Expand Up @@ -61,7 +62,7 @@ bool VirtualKeyboardPrivateMoveCursorFunction::RunImpl() {
return keyboard::MoveCursor(
swipe_direction,
modifier_flags,
ash::Shell::GetPrimaryRootWindow()->GetHost()->dispatcher());
ash::Shell::GetPrimaryRootWindow()->GetHost());
#else
error_ = kNotYetImplementedError;
return false;
Expand Down Expand Up @@ -93,7 +94,7 @@ bool VirtualKeyboardPrivateSendKeyEventFunction::RunImpl() {
key_code,
key_name,
modifiers,
ash::Shell::GetPrimaryRootWindow()->GetHost()->dispatcher());
ash::Shell::GetPrimaryRootWindow()->GetHost());
#else
error_ = kNotYetImplementedError;
return false;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_tabs_apitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#if defined(OS_WIN)
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

// Window resizes are not completed by the time the callback happens,
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/first_run/try_chrome_dialog_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

namespace {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

// static
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/printing/print_dialog_cloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

#if defined(OS_WIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

#if defined(OS_MACOSX)
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/ash/ash_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "chrome/browser/ui/ash/screenshot_taker.h"
#include "chrome/common/chrome_switches.h"
#include "ui/aura/env.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"

#if defined(OS_CHROMEOS)
#include "base/sys_info.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#if defined(OS_WIN)
#include "content/public/browser/web_contents_view.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

using base::ASCIIToUTF16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
#include "chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h"
#include "grit/ui_strings.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_observer.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/shell_dialogs/select_file_dialog.h"

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "content/public/browser/browser_thread.h"
#include "grit/generated_resources.h"
#include "grit/ui_strings.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/l10n/l10n_util.h"

// These conflict with base/tracked_objects.h, so need to come last.
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/views/certificate_viewer_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#if defined(USE_AURA)
#include "chrome/browser/ui/host_desktop.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#endif

namespace {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/views/desktop_media_picker_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "chrome/browser/ui/ash/ash_util.h"
#include "content/public/browser/browser_thread.h"
#include "grit/generated_resources.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
Expand Down
Loading

0 comments on commit 7a60cd3

Please sign in to comment.