diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-06 16:48:23 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-06 16:48:23 +0000 |
commit | 409ab6d55b6aa9cd4e9c00537ee9df00d5b02739 (patch) | |
tree | eb959ced879642547ab3bd5098e2dced4b614364 /ui/views | |
parent | 901f82e959c77e4dde3e3416852ed7bbfcf01ec8 (diff) | |
download | chromium_src-409ab6d55b6aa9cd4e9c00537ee9df00d5b02739.zip chromium_src-409ab6d55b6aa9cd4e9c00537ee9df00d5b02739.tar.gz chromium_src-409ab6d55b6aa9cd4e9c00537ee9df00d5b02739.tar.bz2 |
Clean up WindowEventDispatcher some more.
. Eliminate the implementation of LayerAnimationObserver. It seems no one expects WED to be a LAO anymore.
. Remove WindowTreeHostDelegate. This involves moving some of the functions to WTH, removing some completely, and moving the remainder to the WED public API. A little icky for now, but I plan to take a pass on cleaning up WED's public API once I get it pared down.
. window_tree_host_x11_unittest provided an implementation of WTHD that was not WED. This is not a valid situation now since various functions in WTH now call directly through to WED. Replaced this with a simple EventHandler to test that events are being dispatched.
R=sky@chromium.org
http://crbug.com/308843
Review URL: https://codereview.chromium.org/188223002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc | 14 | ||||
-rw-r--r-- | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc | 14 |
2 files changed, 13 insertions, 15 deletions
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc index b88e3a5..f723aeb 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -586,7 +586,7 @@ void DesktopWindowTreeHostWin::MoveCursorToNative(const gfx::Point& location) { // DesktopWindowTreeHostWin, ui::EventSource implementation: ui::EventProcessor* DesktopWindowTreeHostWin::GetEventProcessor() { - return delegate_->GetEventProcessor(); + return dispatcher(); } //////////////////////////////////////////////////////////////////////////////// @@ -736,11 +736,12 @@ void DesktopWindowTreeHostWin::HandleAppDeactivated() { void DesktopWindowTreeHostWin::HandleActivationChanged(bool active) { // This can be invoked from HWNDMessageHandler::Init(), at which point we're // not in a good state and need to ignore it. - if (!delegate_) + // TODO(beng): Do we need this still now the host owns the dispatcher? + if (!dispatcher()) return; if (active) - delegate_->OnHostActivated(); + OnHostActivated(); desktop_native_widget_aura_->HandleActivationChanged(active); } @@ -752,11 +753,11 @@ bool DesktopWindowTreeHostWin::HandleAppCommand(short command) { } void DesktopWindowTreeHostWin::HandleCancelMode() { - delegate_->OnHostCancelMode(); + dispatcher()->DispatchCancelModeEvent(); } void DesktopWindowTreeHostWin::HandleCaptureLost() { - delegate_->OnHostLostWindowCapture(); + OnHostLostWindowCapture(); native_widget_delegate_->OnMouseCaptureLost(); } @@ -826,8 +827,7 @@ void DesktopWindowTreeHostWin::HandleVisibilityChanged(bool visible) { void DesktopWindowTreeHostWin::HandleClientSizeChanged( const gfx::Size& new_size) { - if (delegate_) - OnHostResized(new_size); + OnHostResized(new_size); } void DesktopWindowTreeHostWin::HandleFrameChanged() { diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 71fe892..4eb30c4 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc @@ -183,7 +183,7 @@ gfx::Rect DesktopWindowTreeHostX11::GetX11RootWindowBounds() const { void DesktopWindowTreeHostX11::HandleNativeWidgetActivationChanged( bool active) { if (active) { - delegate_->OnHostActivated(); + OnHostActivated(); open_windows().remove(xwindow_); open_windows().insert(open_windows().begin(), xwindow_); } @@ -237,7 +237,6 @@ void DesktopWindowTreeHostX11::OnRootWindowCreated( dispatcher_->window()->SetProperty(kViewsWindowForRootWindow, content_window_); dispatcher_->window()->SetProperty(kHostForRootWindow, this); - delegate_ = dispatcher_; // If we're given a parent, we need to mark ourselves as transient to another // window. Otherwise activation gets screwy. @@ -927,7 +926,7 @@ void DesktopWindowTreeHostX11::PrepareForShutdown() { // DesktopWindowTreeHostX11, ui::EventSource implementation: ui::EventProcessor* DesktopWindowTreeHostX11::GetEventProcessor() { - return delegate_->GetEventProcessor(); + return dispatcher(); } //////////////////////////////////////////////////////////////////////////////// @@ -1135,7 +1134,7 @@ void DesktopWindowTreeHostX11::SetUseNativeFrame(bool use_native_frame) { void DesktopWindowTreeHostX11::OnCaptureReleased() { x11_capture_.reset(); g_current_capture = NULL; - delegate_->OnHostLostWindowCapture(); + OnHostLostWindowCapture(); native_widget_delegate_->OnMouseCaptureLost(); } @@ -1348,9 +1347,9 @@ uint32_t DesktopWindowTreeHostX11::Dispatch(const base::NativeEvent& event) { case FocusOut: if (xev->xfocus.mode != NotifyGrab) { ReleaseCapture(); - delegate_->OnHostLostWindowCapture(); + OnHostLostWindowCapture(); } else { - delegate_->OnHostLostMouseGrab(); + dispatcher()->OnHostLostMouseGrab(); } break; case FocusIn: @@ -1421,8 +1420,7 @@ uint32_t DesktopWindowTreeHostX11::Dispatch(const base::NativeEvent& event) { int button = xievent->detail; if (button == kBackMouseButton || button == kForwardMouseButton) { aura::client::UserActionClient* gesture_client = - aura::client::GetUserActionClient( - delegate_->AsDispatcher()->window()); + aura::client::GetUserActionClient(window()); if (gesture_client) { bool reverse_direction = ui::IsTouchpadEvent(xev) && ui::IsNaturalScrollEnabled(); |