| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_manager_factory_service.h" | 5 #include "components/mus/ws/window_manager_factory_service.h" |
| 6 | 6 |
| 7 #include "components/mus/ws/connection_manager.h" | 7 #include "components/mus/ws/connection_manager.h" |
| 8 #include "components/mus/ws/window_tree_impl.h" | 8 #include "components/mus/ws/window_tree_impl.h" |
| 9 | 9 |
| 10 namespace mus { | 10 namespace mus { |
| 11 namespace ws { | 11 namespace ws { |
| 12 | 12 |
| 13 WindowManagerFactoryService::WindowManagerFactoryService( | 13 WindowManagerFactoryService::WindowManagerFactoryService( |
| 14 WindowManagerFactoryRegistry* registry, |
| 15 uint32_t user_id, |
| 14 mojo::InterfaceRequest<mojom::WindowManagerFactoryService> request) | 16 mojo::InterfaceRequest<mojom::WindowManagerFactoryService> request) |
| 15 : binding_(this, std::move(request)) {} | 17 : registry_(registry), |
| 18 user_id_(user_id), |
| 19 binding_(this, std::move(request)) {} |
| 16 | 20 |
| 17 WindowManagerFactoryService::~WindowManagerFactoryService() {} | 21 WindowManagerFactoryService::~WindowManagerFactoryService() {} |
| 18 | 22 |
| 19 void WindowManagerFactoryService::SetWindowManagerFactory( | 23 void WindowManagerFactoryService::SetWindowManagerFactory( |
| 20 mojom::WindowManagerFactoryPtr factory) { | 24 mojom::WindowManagerFactoryPtr factory) { |
| 21 window_manager_factory_ = std::move(factory); | 25 window_manager_factory_ = std::move(factory); |
| 26 registry_->OnWindowManagerFactorySet(); |
| 27 binding_.set_connection_error_handler(base::Bind( |
| 28 &WindowManagerFactoryService::OnConnectionLost, base::Unretained(this))); |
| 29 } |
| 30 |
| 31 void WindowManagerFactoryService::OnConnectionLost() { |
| 32 registry_->OnWindowManagerFactoryConnectionLost(this); |
| 22 } | 33 } |
| 23 | 34 |
| 24 } // namespace ws | 35 } // namespace ws |
| 25 } // namespace mus | 36 } // namespace mus |
| OLD | NEW |