Index: components/mus/public/cpp/lib/window_tree_client_impl.cc |
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc |
index 8e1907ae196bac1e9d9dc4d0e7d95223f5f14fb0..8fbf08137a7e153e91feb788fd153310857ce178 100644 |
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc |
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc |
@@ -243,6 +243,24 @@ void WindowTreeClientImpl::SetBounds(Window* window, |
tree_->SetWindowBounds(change_id, window->id(), mojo::Rect::From(bounds)); |
} |
+void WindowTreeClientImpl::SetCapture(Window* window) { |
+ // In order for us to get here we had to have exposed a window, which implies |
+ // we got a connection. |
+ DCHECK(tree_); |
+ const uint32_t change_id = ScheduleInFlightChange(make_scoped_ptr( |
+ new CrashInFlightChange(window, ChangeType::SET_CAPTURE))); |
sky
2016/02/01 20:43:33
We need to handle requests for capture failing and
jonross
2016/02/03 18:52:17
Done.
|
+ tree_->SetCapture(change_id, window->id()); |
+} |
+ |
+void WindowTreeClientImpl::ReleaseCapture(Window* window) { |
+ // In order for us to get here we had to have exposed a window, which implies |
+ // we got a connection. |
+ DCHECK(tree_); |
+ const uint32_t change_id = ScheduleInFlightChange(make_scoped_ptr( |
+ new CrashInFlightChange(window, ChangeType::RELEASE_CAPTURE))); |
+ tree_->ReleaseCapture(change_id, window->id()); |
+} |
+ |
void WindowTreeClientImpl::SetClientArea( |
Id window_id, |
const gfx::Insets& client_area, |
@@ -554,6 +572,14 @@ void WindowTreeClientImpl::OnUnembed(Id window_id) { |
WindowPrivate(window).LocalDestroy(); |
} |
+void WindowTreeClientImpl::OnLostCapture(Id window_id) { |
+ Window* window = GetWindowById(window_id); |
+ if (window) { |
+ FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(), |
+ OnWindowLostCapture(window)); |
+ } |
+} |
+ |
void WindowTreeClientImpl::OnTopLevelCreated(uint32_t change_id, |
mojom::WindowDataPtr data) { |
// The server ack'd the top level window we created and supplied the state |