| 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 9c6b6257b7f004dc4cb273f444b585052913eca9..18f57f17fa856099cabd82ace9b270b659ee7b9a 100644
|
| --- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
|
| +++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
|
| @@ -207,6 +207,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)));
|
| + 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) {
|
| DCHECK(tree_);
|
| @@ -434,6 +452,14 @@ void WindowTreeClientImpl::OnUnembed() {
|
| delete this;
|
| }
|
|
|
| +void WindowTreeClientImpl::OnLostCapture(Id window_id) {
|
| + Window* window = GetWindowById(window_id);
|
| + if (window) {
|
| + FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(),
|
| + OnWindowLostCapture(window));
|
| + }
|
| +}
|
| +
|
| void WindowTreeClientImpl::OnWindowBoundsChanged(Id window_id,
|
| mojo::RectPtr old_bounds,
|
| mojo::RectPtr new_bounds) {
|
|
|