| 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 #ifndef SERVICES_UI_SERVICE_H_ | 5 #ifndef SERVICES_UI_SERVICE_H_ |
| 6 #define SERVICES_UI_SERVICE_H_ | 6 #define SERVICES_UI_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 public service_manager::InterfaceFactory<mojom::WindowTreeFactory>, | 76 public service_manager::InterfaceFactory<mojom::WindowTreeFactory>, |
| 77 public service_manager::InterfaceFactory<mojom::WindowTreeHostFactory>, | 77 public service_manager::InterfaceFactory<mojom::WindowTreeHostFactory>, |
| 78 public service_manager::InterfaceFactory< | 78 public service_manager::InterfaceFactory< |
| 79 discardable_memory::mojom::DiscardableSharedMemoryManager>, | 79 discardable_memory::mojom::DiscardableSharedMemoryManager>, |
| 80 public service_manager::InterfaceFactory<mojom::WindowServerTest> { | 80 public service_manager::InterfaceFactory<mojom::WindowServerTest> { |
| 81 public: | 81 public: |
| 82 Service(); | 82 Service(); |
| 83 ~Service() override; | 83 ~Service() override; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 // How the ScreenManager is configured. |
| 87 enum ScreenManagerConfig { |
| 88 // Initial state. |
| 89 UNKNOWN, |
| 90 |
| 91 // ScreenManager runs locally. |
| 92 INTERNAL, |
| 93 |
| 94 // Used when the window manager supplies a value of false for |
| 95 // |automatically_create_display_roots|. In this config the ScreenManager |
| 96 // is configured to forward calls. |
| 97 FORWARDING, |
| 98 }; |
| 99 |
| 86 // Holds InterfaceRequests received before the first WindowTreeHost Display | 100 // Holds InterfaceRequests received before the first WindowTreeHost Display |
| 87 // has been established. | 101 // has been established. |
| 88 struct PendingRequest; | 102 struct PendingRequest; |
| 89 struct UserState; | 103 struct UserState; |
| 90 | 104 |
| 91 using UserIdToUserState = std::map<ws::UserId, std::unique_ptr<UserState>>; | 105 using UserIdToUserState = std::map<ws::UserId, std::unique_ptr<UserState>>; |
| 92 | 106 |
| 93 void InitializeResources(service_manager::Connector* connector); | 107 void InitializeResources(service_manager::Connector* connector); |
| 94 | 108 |
| 95 // Returns the user specific state for the user id of |remote_identity|. | 109 // Returns the user specific state for the user id of |remote_identity|. |
| 96 // Service owns the return value. | 110 // Service owns the return value. |
| 97 // TODO(sky): if we allow removal of user ids then we need to close anything | 111 // TODO(sky): if we allow removal of user ids then we need to close anything |
| 98 // associated with the user (all incoming pipes...) on removal. | 112 // associated with the user (all incoming pipes...) on removal. |
| 99 UserState* GetUserState(const service_manager::Identity& remote_identity); | 113 UserState* GetUserState(const service_manager::Identity& remote_identity); |
| 100 | 114 |
| 101 void AddUserIfNecessary(const service_manager::Identity& remote_identity); | 115 void AddUserIfNecessary(const service_manager::Identity& remote_identity); |
| 102 | 116 |
| 103 // service_manager::Service: | 117 // service_manager::Service: |
| 104 void OnStart() override; | 118 void OnStart() override; |
| 105 void OnBindInterface(const service_manager::ServiceInfo& source_info, | 119 void OnBindInterface(const service_manager::ServiceInfo& source_info, |
| 106 const std::string& interface_name, | 120 const std::string& interface_name, |
| 107 mojo::ScopedMessagePipeHandle interface_pipe) override; | 121 mojo::ScopedMessagePipeHandle interface_pipe) override; |
| 108 | 122 |
| 109 // WindowServerDelegate: | 123 // WindowServerDelegate: |
| 110 void StartDisplayInit() override; | 124 void StartDisplayInit() override; |
| 111 void OnFirstDisplayReady() override; | 125 void OnFirstDisplayReady() override; |
| 112 void OnNoMoreDisplays() override; | 126 void OnNoMoreDisplays() override; |
| 113 bool IsTestConfig() const override; | 127 bool IsTestConfig() const override; |
| 128 void OnWillCreateTreeForWindowManager( |
| 129 bool automatically_create_display_roots) override; |
| 114 | 130 |
| 115 // service_manager::InterfaceFactory<mojom::AccessibilityManager> | 131 // service_manager::InterfaceFactory<mojom::AccessibilityManager> |
| 116 // implementation. | 132 // implementation. |
| 117 void Create(const service_manager::Identity& remote_identity, | 133 void Create(const service_manager::Identity& remote_identity, |
| 118 mojom::AccessibilityManagerRequest request) override; | 134 mojom::AccessibilityManagerRequest request) override; |
| 119 | 135 |
| 120 // service_manager::InterfaceFactory<mojom::Clipboard> implementation. | 136 // service_manager::InterfaceFactory<mojom::Clipboard> implementation. |
| 121 void Create(const service_manager::Identity& remote_identity, | 137 void Create(const service_manager::Identity& remote_identity, |
| 122 mojom::ClipboardRequest request) override; | 138 mojom::ClipboardRequest request) override; |
| 123 | 139 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 std::unique_ptr<display::ScreenManager> screen_manager_; | 207 std::unique_ptr<display::ScreenManager> screen_manager_; |
| 192 | 208 |
| 193 IMERegistrarImpl ime_registrar_; | 209 IMERegistrarImpl ime_registrar_; |
| 194 IMEServerImpl ime_server_; | 210 IMEServerImpl ime_server_; |
| 195 | 211 |
| 196 std::unique_ptr<discardable_memory::DiscardableSharedMemoryManager> | 212 std::unique_ptr<discardable_memory::DiscardableSharedMemoryManager> |
| 197 discardable_shared_memory_manager_; | 213 discardable_shared_memory_manager_; |
| 198 | 214 |
| 199 service_manager::BinderRegistry registry_; | 215 service_manager::BinderRegistry registry_; |
| 200 | 216 |
| 217 // Set to true in StartDisplayInit(). |
| 218 bool is_gpu_ready_ = false; |
| 219 ScreenManagerConfig screen_manager_config_ = ScreenManagerConfig::UNKNOWN; |
| 220 |
| 201 DISALLOW_COPY_AND_ASSIGN(Service); | 221 DISALLOW_COPY_AND_ASSIGN(Service); |
| 202 }; | 222 }; |
| 203 | 223 |
| 204 } // namespace ui | 224 } // namespace ui |
| 205 | 225 |
| 206 #endif // SERVICES_UI_SERVICE_H_ | 226 #endif // SERVICES_UI_SERVICE_H_ |
| OLD | NEW |