Chromium Code Reviews| 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 121c7ced2d32c3ad994ce76c4eb72483e054b8d9..afdde850b09c33bcbc19880b24da56cca5e8f5da 100644 |
| --- a/components/mus/ws/window_tree_impl.cc |
| +++ b/components/mus/ws/window_tree_impl.cc |
| @@ -550,6 +550,11 @@ bool WindowTreeImpl::ShouldRouteToWindowManager( |
| return is_wm ? false : true; |
| } |
| +void WindowTreeImpl::ProcessLostCapture( |
| + const ServerWindow* old_capture_window) { |
| + client()->OnLostCapture(WindowIdToTransportId(old_capture_window->id())); |
|
sky
2016/01/22 00:55:00
You should only send this if it was not initiated
jonross
2016/01/26 18:38:50
Done.
|
| +} |
| + |
| bool WindowTreeImpl::IsWindowKnown(const ServerWindow* window) const { |
| return known_windows_.count(WindowIdToTransportId(window->id())) > 0; |
| } |
| @@ -910,6 +915,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(window); |
| + bool success = window && access_policy_->CanSetCapture(window) && host && |
| + access_policy_->CanSetCapture(host->GetCaptureWindow()); |
|
sky
2016/01/22 00:55:00
I am worried about letting any application capture
jonross
2016/01/22 20:31:28
I would also believe that touch events would also
sky
2016/01/22 22:15:37
Agreed.
jonross
2016/01/26 18:38:50
Yes: MenuController::Run eventually triggers
sky
2016/01/26 22:11:14
While the windows are different, it's the same cli
jonross
2016/01/26 22:35:15
It should always be the same client which has proc
jonross
2016/01/27 21:15:13
sadrul@ did raise a concern that we could have sit
|
| + 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(window); |
| + bool success = |
| + window && host && access_policy_->CanSetCapture(host->GetCaptureWindow()); |
| + if (success) { |
| + Operation op(this, connection_manager_, OperationType::RELEASE_CAPTURE); |
| + host->SetCapture(nullptr); |
|
sky
2016/01/22 00:55:00
They way you have this now is set capture to null
jonross
2016/01/26 18:38:50
Done.
|
| + } |
| + client_->OnChangeCompleted(change_id, success); |
| +} |
| + |
| void WindowTreeImpl::SetWindowBounds(uint32_t change_id, |
| Id window_id, |
| mojo::RectPtr bounds) { |