OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/window_manager_application.h" | 5 #include "mash/wm/window_manager_application.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "components/mus/public/cpp/event_matcher.h" | 10 #include "components/mus/public/cpp/event_matcher.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 wm_factory_service->SetWindowManagerFactory( | 114 wm_factory_service->SetWindowManagerFactory( |
115 window_manager_factory_binding_.CreateInterfacePtrAndBind()); | 115 window_manager_factory_binding_.CreateInterfacePtrAndBind()); |
116 | 116 |
117 user_window_controller_.reset(new UserWindowControllerImpl()); | 117 user_window_controller_.reset(new UserWindowControllerImpl()); |
118 | 118 |
119 root_controllers_.insert( | 119 root_controllers_.insert( |
120 RootWindowController::CreateUsingWindowTreeHost(this)); | 120 RootWindowController::CreateUsingWindowTreeHost(this)); |
121 } | 121 } |
122 | 122 |
123 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { | 123 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { |
124 connection->AddService<mash::wm::mojom::UserWindowController>(this); | 124 connection->AddInterface<mash::wm::mojom::UserWindowController>(this); |
125 connection->AddService<mus::mojom::AcceleratorRegistrar>(this); | 125 connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 void WindowManagerApplication::Create( | 129 void WindowManagerApplication::Create( |
130 mojo::Connection* connection, | 130 mojo::Connection* connection, |
131 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { | 131 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { |
132 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { | 132 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { |
133 user_window_controller_binding_.AddBinding(user_window_controller_.get(), | 133 user_window_controller_binding_.AddBinding(user_window_controller_.get(), |
134 std::move(request)); | 134 std::move(request)); |
135 } else { | 135 } else { |
(...skipping 23 matching lines...) Expand all Loading... |
159 | 159 |
160 void WindowManagerApplication::CreateWindowManager( | 160 void WindowManagerApplication::CreateWindowManager( |
161 mus::mojom::DisplayPtr display, | 161 mus::mojom::DisplayPtr display, |
162 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 162 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
163 root_controllers_.insert(RootWindowController::CreateFromDisplay( | 163 root_controllers_.insert(RootWindowController::CreateFromDisplay( |
164 this, std::move(display), std::move(client_request))); | 164 this, std::move(display), std::move(client_request))); |
165 } | 165 } |
166 | 166 |
167 } // namespace wm | 167 } // namespace wm |
168 } // namespace mash | 168 } // namespace mash |
OLD | NEW |