Index: components/mus/ws/window_tree_impl.cc |
diff --git a/components/mus/ws/window_tree_impl.cc b/components/mus/ws/window_tree_impl.cc |
index d783982079ea319788602ebe4645527d9963ad93..d778a026d7bf63c8a60624e4aea76ba14b57c0c6 100644 |
--- a/components/mus/ws/window_tree_impl.cc |
+++ b/components/mus/ws/window_tree_impl.cc |
@@ -403,6 +403,11 @@ bool WindowTreeImpl::ShouldRouteToWindowManager( |
return true; |
} |
+void WindowTreeImpl::ProcessLostCapture( |
+ const ServerWindow* old_capture_window) { |
+ client()->OnLostCapture(WindowIdToTransportId(old_capture_window->id())); |
+} |
+ |
bool WindowTreeImpl::IsWindowKnown(const ServerWindow* window) const { |
return known_windows_.count(WindowIdToTransportId(window->id())) > 0; |
} |
@@ -697,6 +702,30 @@ void WindowTreeImpl::GetWindowTree( |
callback.Run(WindowsToWindowDatas(windows)); |
} |
+void WindowTreeImpl::SetCapture(uint32_t change_id, Id window_id) { |
+ ServerWindow* window = GetWindow(WindowIdFromTransportId(window_id)); |
+ WindowTreeHostImpl* host = GetHost(); |
+ bool success = window && access_policy_->CanSetCapture(window) && host && |
+ access_policy_->CanSetCapture(host->GetCaptureWindow()); |
+ if (success) { |
+ Operation op(this, connection_manager_, OperationType::SET_CAPTURE); |
+ host->SetCapture(window); |
+ } |
+ client_->OnChangeCompleted(change_id, success); |
+} |
+ |
+void WindowTreeImpl::ReleaseCapture(uint32_t change_id, Id window_id) { |
+ ServerWindow* window = GetWindow(WindowIdFromTransportId(window_id)); |
+ WindowTreeHostImpl* host = GetHost(); |
+ bool success = |
+ window && host && access_policy_->CanSetCapture(host->GetCaptureWindow()); |
+ if (success) { |
+ Operation op(this, connection_manager_, OperationType::RELEASE_CAPTURE); |
+ host->SetCapture(nullptr); |
+ } |
+ client_->OnChangeCompleted(change_id, success); |
+} |
+ |
void WindowTreeImpl::SetWindowBounds(uint32_t change_id, |
Id window_id, |
mojo::RectPtr bounds) { |