| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_SERVICE_H_ | |
| 6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_SERVICE_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | |
| 11 #include "components/mus/ws/user_id.h" | |
| 12 #include "mojo/public/cpp/bindings/binding.h" | |
| 13 | |
| 14 namespace mus { | |
| 15 namespace ws { | |
| 16 | |
| 17 class ServerWindow; | |
| 18 class WindowManagerFactoryRegistry; | |
| 19 | |
| 20 namespace test { | |
| 21 class WindowManagerFactoryRegistryTestApi; | |
| 22 } | |
| 23 | |
| 24 class WindowManagerFactoryService : public mojom::WindowManagerFactoryService { | |
| 25 public: | |
| 26 WindowManagerFactoryService( | |
| 27 WindowManagerFactoryRegistry* registry, | |
| 28 const UserId& user_id, | |
| 29 mojo::InterfaceRequest<mojom::WindowManagerFactoryService> request); | |
| 30 ~WindowManagerFactoryService() override; | |
| 31 | |
| 32 const UserId& user_id() const { return user_id_; } | |
| 33 | |
| 34 mojom::WindowManagerFactory* window_manager_factory() { | |
| 35 return window_manager_factory_; | |
| 36 } | |
| 37 | |
| 38 // mojom::WindowManagerFactoryService: | |
| 39 void SetWindowManagerFactory(mojom::WindowManagerFactoryPtr factory) override; | |
| 40 | |
| 41 private: | |
| 42 friend class test::WindowManagerFactoryRegistryTestApi; | |
| 43 | |
| 44 // Used by tests. | |
| 45 WindowManagerFactoryService(WindowManagerFactoryRegistry* registry, | |
| 46 const UserId& user_id); | |
| 47 | |
| 48 void SetWindowManagerFactoryImpl(mojom::WindowManagerFactory* factory); | |
| 49 void OnConnectionLost(); | |
| 50 | |
| 51 WindowManagerFactoryRegistry* registry_; | |
| 52 const UserId user_id_; | |
| 53 mojo::Binding<mojom::WindowManagerFactoryService> binding_; | |
| 54 mojom::WindowManagerFactoryPtr window_manager_factory_ptr_; | |
| 55 // Typically the same as |window_manager_factory_ptr_|, but differs for | |
| 56 // tests that don't create bindings. | |
| 57 mojom::WindowManagerFactory* window_manager_factory_; | |
| 58 | |
| 59 DISALLOW_COPY_AND_ASSIGN(WindowManagerFactoryService); | |
| 60 }; | |
| 61 | |
| 62 } // namespace ws | |
| 63 } // namespace mus | |
| 64 | |
| 65 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_SERVICE_H_ | |
| OLD | NEW |