| 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 #ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_REGISTRY_H_ | 5 #ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_REGISTRY_H_ |
| 6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_REGISTRY_H_ | 6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | 15 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" |
| 16 #include "components/mus/ws/user_id_tracker_observer.h" | 16 #include "components/mus/ws/user_id_tracker_observer.h" |
| 17 | 17 |
| 18 namespace mus { | 18 namespace mus { |
| 19 namespace ws { | 19 namespace ws { |
| 20 | 20 |
| 21 class UserIdTracker; | 21 class UserIdTracker; |
| 22 class WindowManagerFactoryRegistryObserver; | 22 class WindowManagerFactoryRegistryObserver; |
| 23 class WindowManagerFactoryService; | 23 class WindowManagerFactoryService; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 std::vector<WindowManagerFactoryService*> GetServices(); | 42 std::vector<WindowManagerFactoryService*> GetServices(); |
| 43 | 43 |
| 44 void AddObserver(WindowManagerFactoryRegistryObserver* observer); | 44 void AddObserver(WindowManagerFactoryRegistryObserver* observer); |
| 45 void RemoveObserver(WindowManagerFactoryRegistryObserver* observer); | 45 void RemoveObserver(WindowManagerFactoryRegistryObserver* observer); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 friend class WindowManagerFactoryService; | 48 friend class WindowManagerFactoryService; |
| 49 friend class test::WindowManagerFactoryRegistryTestApi; | 49 friend class test::WindowManagerFactoryRegistryTestApi; |
| 50 | 50 |
| 51 void AddServiceImpl(scoped_ptr<WindowManagerFactoryService> service); | 51 void AddServiceImpl(std::unique_ptr<WindowManagerFactoryService> service); |
| 52 | 52 |
| 53 bool ContainsServiceForUser(const UserId& user_id) const; | 53 bool ContainsServiceForUser(const UserId& user_id) const; |
| 54 void OnWindowManagerFactoryConnectionLost( | 54 void OnWindowManagerFactoryConnectionLost( |
| 55 WindowManagerFactoryService* service); | 55 WindowManagerFactoryService* service); |
| 56 void OnWindowManagerFactorySet(WindowManagerFactoryService* service); | 56 void OnWindowManagerFactorySet(WindowManagerFactoryService* service); |
| 57 | 57 |
| 58 // UserIdTrackerObserver: | 58 // UserIdTrackerObserver: |
| 59 void OnActiveUserIdChanged(const UserId& previously_active_id, | 59 void OnActiveUserIdChanged(const UserId& previously_active_id, |
| 60 const UserId& active_id) override; | 60 const UserId& active_id) override; |
| 61 void OnUserIdAdded(const UserId& id) override; | 61 void OnUserIdAdded(const UserId& id) override; |
| 62 void OnUserIdRemoved(const UserId& id) override; | 62 void OnUserIdRemoved(const UserId& id) override; |
| 63 | 63 |
| 64 // Set to true the first time a valid factory has been found. | 64 // Set to true the first time a valid factory has been found. |
| 65 bool got_valid_factory_ = false; | 65 bool got_valid_factory_ = false; |
| 66 UserIdTracker* id_tracker_; | 66 UserIdTracker* id_tracker_; |
| 67 WindowServer* window_server_; | 67 WindowServer* window_server_; |
| 68 | 68 |
| 69 std::vector<scoped_ptr<WindowManagerFactoryService>> services_; | 69 std::vector<std::unique_ptr<WindowManagerFactoryService>> services_; |
| 70 | 70 |
| 71 base::ObserverList<WindowManagerFactoryRegistryObserver> observers_; | 71 base::ObserverList<WindowManagerFactoryRegistryObserver> observers_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(WindowManagerFactoryRegistry); | 73 DISALLOW_COPY_AND_ASSIGN(WindowManagerFactoryRegistry); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace ws | 76 } // namespace ws |
| 77 } // namespace mus | 77 } // namespace mus |
| 78 | 78 |
| 79 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_REGISTRY_H_ | 79 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_FACTORY_REGISTRY_H_ |
| OLD | NEW |