| Index: components/mus/ws/window_tree.cc
|
| diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
|
| index 0114bf5e89484c2ea0a5aa308e023c9861395187..a07f454da7e8da92ce0912f2d28ed6fb2a6cf2c6 100644
|
| --- a/components/mus/ws/window_tree.cc
|
| +++ b/components/mus/ws/window_tree.cc
|
| @@ -673,6 +673,15 @@ WindowManagerState* WindowTree::GetWindowManagerStateForWindowManager() {
|
| return wms;
|
| }
|
|
|
| +WindowManagerState* WindowTree::GetWindowManagerStateForUser() {
|
| + Display* display = display_manager()->displays().empty()
|
| + ? nullptr
|
| + : *(display_manager()->displays().begin());
|
| + return display && user_id_ != InvalidUserId()
|
| + ? display->GetWindowManagerStateForUser(user_id_)
|
| + : nullptr;
|
| +}
|
| +
|
| bool WindowTree::ShouldRouteToWindowManager(const ServerWindow* window) const {
|
| // If the client created this window, then do not route it through the WM.
|
| if (window->id().connection_id == id_)
|
| @@ -986,15 +995,8 @@ void WindowTree::NewTopLevelWindow(
|
| mojo::Map<mojo::String, mojo::Array<uint8_t>> transport_properties) {
|
| DCHECK(!waiting_for_top_level_window_info_);
|
| const ClientWindowId client_window_id(transport_window_id);
|
| - // TODO(sky): need a way for client to provide context to figure out display.
|
| - Display* display = display_manager()->displays().empty()
|
| - ? nullptr
|
| - : *(display_manager()->displays().begin());
|
| // TODO(sky): move checks to accesspolicy.
|
| - WindowManagerState* wms =
|
| - display && user_id_ != InvalidUserId()
|
| - ? display->GetWindowManagerStateForUser(user_id_)
|
| - : nullptr;
|
| + WindowManagerState* wms = GetWindowManagerStateForUser();
|
| if (!wms || wms->tree() == this || !IsValidIdForNewWindow(client_window_id)) {
|
| client()->OnChangeCompleted(change_id, false);
|
| return;
|
| @@ -1331,6 +1333,12 @@ void WindowTree::GetWindowManagerClient(
|
| this, std::move(internal)));
|
| }
|
|
|
| +void WindowTree::GetCursorLocationMemory(
|
| + const GetCursorLocationMemoryCallback& callback) {
|
| + WindowManagerState* wms = GetWindowManagerStateForUser();
|
| + callback.Run(wms->GetCursorLocationMemory());
|
| +}
|
| +
|
| void WindowTree::AddAccelerator(uint32_t id,
|
| mojom::EventMatcherPtr event_matcher,
|
| const AddAcceleratorCallback& callback) {
|
|
|