| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/mus/ws/window_tree.h" | 5 #include "components/mus/ws/window_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "components/mus/ws/default_access_policy.h" | 15 #include "components/mus/ws/default_access_policy.h" |
| 16 #include "components/mus/ws/display.h" | 16 #include "components/mus/ws/display.h" |
| 17 #include "components/mus/ws/display_manager.h" | 17 #include "components/mus/ws/display_manager.h" |
| 18 #include "components/mus/ws/event_matcher.h" | 18 #include "components/mus/ws/event_matcher.h" |
| 19 #include "components/mus/ws/focus_controller.h" | 19 #include "components/mus/ws/focus_controller.h" |
| 20 #include "components/mus/ws/operation.h" | 20 #include "components/mus/ws/operation.h" |
| 21 #include "components/mus/ws/platform_display.h" | 21 #include "components/mus/ws/platform_display.h" |
| 22 #include "components/mus/ws/server_window.h" | 22 #include "components/mus/ws/server_window.h" |
| 23 #include "components/mus/ws/server_window_observer.h" | 23 #include "components/mus/ws/server_window_observer.h" |
| 24 #include "components/mus/ws/user_display_manager.h" |
| 24 #include "components/mus/ws/window_manager_state.h" | 25 #include "components/mus/ws/window_manager_state.h" |
| 25 #include "components/mus/ws/window_server.h" | 26 #include "components/mus/ws/window_server.h" |
| 26 #include "components/mus/ws/window_tree_binding.h" | 27 #include "components/mus/ws/window_tree_binding.h" |
| 27 #include "mojo/converters/geometry/geometry_type_converters.h" | 28 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 28 #include "mojo/converters/ime/ime_type_converters.h" | 29 #include "mojo/converters/ime/ime_type_converters.h" |
| 29 #include "mojo/converters/input_events/input_events_type_converters.h" | 30 #include "mojo/converters/input_events/input_events_type_converters.h" |
| 30 #include "mojo/converters/surfaces/surfaces_type_converters.h" | 31 #include "mojo/converters/surfaces/surfaces_type_converters.h" |
| 31 #include "ui/platform_window/text_input_state.h" | 32 #include "ui/platform_window/text_input_state.h" |
| 32 | 33 |
| 33 using mojo::Array; | 34 using mojo::Array; |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) { | 1325 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) { |
| 1325 if (!access_policy_->CanSetWindowManager() || !window_manager_internal_ || | 1326 if (!access_policy_->CanSetWindowManager() || !window_manager_internal_ || |
| 1326 window_manager_internal_client_binding_) { | 1327 window_manager_internal_client_binding_) { |
| 1327 return; | 1328 return; |
| 1328 } | 1329 } |
| 1329 window_manager_internal_client_binding_.reset( | 1330 window_manager_internal_client_binding_.reset( |
| 1330 new mojo::AssociatedBinding<mojom::WindowManagerClient>( | 1331 new mojo::AssociatedBinding<mojom::WindowManagerClient>( |
| 1331 this, std::move(internal))); | 1332 this, std::move(internal))); |
| 1332 } | 1333 } |
| 1333 | 1334 |
| 1335 void WindowTree::GetCursorLocationMemory( |
| 1336 const GetCursorLocationMemoryCallback& callback) { |
| 1337 callback.Run( |
| 1338 window_server_->display_manager()->GetUserDisplayManager(user_id_)-> |
| 1339 GetCursorLocationMemory()); |
| 1340 } |
| 1341 |
| 1334 void WindowTree::AddAccelerator(uint32_t id, | 1342 void WindowTree::AddAccelerator(uint32_t id, |
| 1335 mojom::EventMatcherPtr event_matcher, | 1343 mojom::EventMatcherPtr event_matcher, |
| 1336 const AddAcceleratorCallback& callback) { | 1344 const AddAcceleratorCallback& callback) { |
| 1337 WindowManagerState* wms = GetWindowManagerStateForWindowManager(); | 1345 WindowManagerState* wms = GetWindowManagerStateForWindowManager(); |
| 1338 const bool success = | 1346 const bool success = |
| 1339 wms->event_dispatcher()->AddAccelerator(id, std::move(event_matcher)); | 1347 wms->event_dispatcher()->AddAccelerator(id, std::move(event_matcher)); |
| 1340 callback.Run(success); | 1348 callback.Run(success); |
| 1341 } | 1349 } |
| 1342 | 1350 |
| 1343 void WindowTree::RemoveAccelerator(uint32_t id) { | 1351 void WindowTree::RemoveAccelerator(uint32_t id) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 } | 1439 } |
| 1432 | 1440 |
| 1433 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1441 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
| 1434 const ServerWindow* window) const { | 1442 const ServerWindow* window) const { |
| 1435 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1443 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
| 1436 return tree && tree != this; | 1444 return tree && tree != this; |
| 1437 } | 1445 } |
| 1438 | 1446 |
| 1439 } // namespace ws | 1447 } // namespace ws |
| 1440 } // namespace mus | 1448 } // namespace mus |
| OLD | NEW |