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 "services/ui/ws/window_server.h" | 5 #include "services/ui/ws/window_server.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 display_manager_(new DisplayManager(this, &user_id_tracker_)), | 53 display_manager_(new DisplayManager(this, &user_id_tracker_)), |
54 current_operation_(nullptr), | 54 current_operation_(nullptr), |
55 in_destructor_(false), | 55 in_destructor_(false), |
56 next_wm_change_id_(0), | 56 next_wm_change_id_(0), |
57 gpu_host_(new GpuHost(this)), | 57 gpu_host_(new GpuHost(this)), |
58 window_manager_window_tree_factory_set_(this, &user_id_tracker_), | 58 window_manager_window_tree_factory_set_(this, &user_id_tracker_), |
59 display_compositor_client_binding_(this) { | 59 display_compositor_client_binding_(this) { |
60 user_id_tracker_.AddObserver(this); | 60 user_id_tracker_.AddObserver(this); |
61 OnUserIdAdded(user_id_tracker_.active_id()); | 61 OnUserIdAdded(user_id_tracker_.active_id()); |
62 gpu_host_->CreateDisplayCompositor( | 62 gpu_host_->CreateDisplayCompositor( |
63 mojo::GetProxy(&display_compositor_), | 63 mojo::MakeRequest(&display_compositor_), |
64 display_compositor_client_binding_.CreateInterfacePtrAndBind()); | 64 display_compositor_client_binding_.CreateInterfacePtrAndBind()); |
65 } | 65 } |
66 | 66 |
67 WindowServer::~WindowServer() { | 67 WindowServer::~WindowServer() { |
68 in_destructor_ = true; | 68 in_destructor_ = true; |
69 | 69 |
70 for (auto& pair : tree_map_) | 70 for (auto& pair : tree_map_) |
71 pair.second->PrepareForWindowServerShutdown(); | 71 pair.second->PrepareForWindowServerShutdown(); |
72 | 72 |
73 // Destroys the window trees results in querying for the display. Tear down | 73 // Destroys the window trees results in querying for the display. Tear down |
(...skipping 27 matching lines...) Expand all Loading... |
101 mojom::WindowTreeClientPtr client, | 101 mojom::WindowTreeClientPtr client, |
102 uint32_t flags, | 102 uint32_t flags, |
103 std::unique_ptr<AccessPolicy> access_policy) { | 103 std::unique_ptr<AccessPolicy> access_policy) { |
104 std::unique_ptr<WindowTree> tree_ptr( | 104 std::unique_ptr<WindowTree> tree_ptr( |
105 new WindowTree(this, user_id, root, std::move(access_policy))); | 105 new WindowTree(this, user_id, root, std::move(access_policy))); |
106 WindowTree* tree = tree_ptr.get(); | 106 WindowTree* tree = tree_ptr.get(); |
107 if (flags & mojom::kEmbedFlagEmbedderInterceptsEvents) | 107 if (flags & mojom::kEmbedFlagEmbedderInterceptsEvents) |
108 tree->set_embedder_intercepts_events(); | 108 tree->set_embedder_intercepts_events(); |
109 | 109 |
110 mojom::WindowTreePtr window_tree_ptr; | 110 mojom::WindowTreePtr window_tree_ptr; |
111 mojom::WindowTreeRequest window_tree_request = GetProxy(&window_tree_ptr); | 111 mojom::WindowTreeRequest window_tree_request = MakeRequest(&window_tree_ptr); |
112 std::unique_ptr<WindowTreeBinding> binding = | 112 std::unique_ptr<WindowTreeBinding> binding = |
113 delegate_->CreateWindowTreeBinding( | 113 delegate_->CreateWindowTreeBinding( |
114 WindowServerDelegate::BindingType::EMBED, this, tree, | 114 WindowServerDelegate::BindingType::EMBED, this, tree, |
115 &window_tree_request, &client); | 115 &window_tree_request, &client); |
116 if (!binding) { | 116 if (!binding) { |
117 binding = base::MakeUnique<ws::DefaultWindowTreeBinding>( | 117 binding = base::MakeUnique<ws::DefaultWindowTreeBinding>( |
118 tree, this, std::move(window_tree_request), std::move(client)); | 118 tree, this, std::move(window_tree_request), std::move(client)); |
119 } | 119 } |
120 | 120 |
121 AddTree(std::move(tree_ptr), std::move(binding), std::move(window_tree_ptr)); | 121 AddTree(std::move(tree_ptr), std::move(binding), std::move(window_tree_ptr)); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 void WindowServer::OnUserIdAdded(const UserId& id) { | 821 void WindowServer::OnUserIdAdded(const UserId& id) { |
822 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 822 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
823 } | 823 } |
824 | 824 |
825 void WindowServer::OnUserIdRemoved(const UserId& id) { | 825 void WindowServer::OnUserIdRemoved(const UserId& id) { |
826 activity_monitor_map_.erase(id); | 826 activity_monitor_map_.erase(id); |
827 } | 827 } |
828 | 828 |
829 } // namespace ws | 829 } // namespace ws |
830 } // namespace ui | 830 } // namespace ui |
OLD | NEW |