Chromium Code Reviews| Index: components/mus/ws/window_tree_host_impl.cc |
| diff --git a/components/mus/ws/window_tree_host_impl.cc b/components/mus/ws/window_tree_host_impl.cc |
| index f1200a6648dfae284c3b77363ad603769772aaf8..69d72a6b1c972b1c514072cf751a5a76fd9361ae 100644 |
| --- a/components/mus/ws/window_tree_host_impl.cc |
| +++ b/components/mus/ws/window_tree_host_impl.cc |
| @@ -167,6 +167,18 @@ const mojom::ViewportMetrics& WindowTreeHostImpl::GetViewportMetrics() const { |
| return display_manager_->GetViewportMetrics(); |
| } |
| +void WindowTreeHostImpl::SetCapture(ServerWindow* window, |
| + bool in_nonclient_area) { |
| + ServerWindow* capture_window = event_dispatcher_.capture_window(); |
| + if (capture_window == window) |
| + return; |
| + event_dispatcher_.SetCaptureWindow(window, in_nonclient_area); |
| + if (window) |
| + display_manager_->SetCapture(); |
|
sky
2016/02/08 16:57:11
I think this is the wrong place for setting/releas
jonross
2016/02/10 15:57:57
Updated EventDispatcherDelegate to have Set/Releas
|
| + else |
| + display_manager_->ReleaseCapture(); |
| +} |
| + |
| mojom::Rotation WindowTreeHostImpl::GetRotation() const { |
| return display_manager_->GetRotation(); |
| } |
| @@ -399,6 +411,10 @@ void WindowTreeHostImpl::OnEvent(const ui::Event& event) { |
| event_dispatcher_.ProcessEvent(std::move(mojo_event)); |
| } |
| +void WindowTreeHostImpl::OnLostCapture() { |
| + SetCapture(nullptr, false); |
| +} |
| + |
| void WindowTreeHostImpl::OnDisplayClosed() { |
| if (delegate_) |
| delegate_->OnDisplayClosed(); |
| @@ -530,6 +546,11 @@ ServerWindow* WindowTreeHostImpl::GetFocusedWindowForEventDispatcher() { |
| return GetFocusedWindow(); |
| } |
| +void WindowTreeHostImpl::OnLostCapture(ServerWindow* window) { |
| + DCHECK(window); |
| + connection_manager_->ProcessLostCapture(window); |
| +} |
| + |
| void WindowTreeHostImpl::DispatchInputEventToWindow(ServerWindow* target, |
| bool in_nonclient_area, |
| mojom::EventPtr event) { |