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 #ifndef COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 5 #ifndef COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
6 #define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 6 #define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // Gets the global instance of the ARC Service Manager. This can only be | 40 // Gets the global instance of the ARC Service Manager. This can only be |
41 // called on the thread that this class was created on. | 41 // called on the thread that this class was created on. |
42 static ArcServiceManager* Get(); | 42 static ArcServiceManager* Get(); |
43 | 43 |
44 // Called when the main profile is initialized after user logs in. | 44 // Called when the main profile is initialized after user logs in. |
45 void OnPrimaryUserProfilePrepared( | 45 void OnPrimaryUserProfilePrepared( |
46 const AccountId& account_id, | 46 const AccountId& account_id, |
47 std::unique_ptr<BooleanPrefMember> arc_enabled_pref); | 47 std::unique_ptr<BooleanPrefMember> arc_enabled_pref); |
48 | 48 |
49 // Called once the windowing system (ash) has been started. | |
50 void OnAshStarted(); | |
51 | |
52 // Called to shut down all ARC services. | 49 // Called to shut down all ARC services. |
53 void Shutdown(); | 50 void Shutdown(); |
54 | 51 |
55 scoped_refptr<base::TaskRunner> blocking_task_runner() const { | 52 scoped_refptr<base::TaskRunner> blocking_task_runner() const { |
56 return blocking_task_runner_; | 53 return blocking_task_runner_; |
57 } | 54 } |
58 | 55 |
59 // Set ArcBridgeService instance for testing. Call before ArcServiceManager | 56 // Set ArcBridgeService instance for testing. Call before ArcServiceManager |
60 // creation. ArcServiceManager owns |arc_bridge_service|. | 57 // creation. ArcServiceManager owns |arc_bridge_service|. |
61 static void SetArcBridgeServiceForTesting( | 58 static void SetArcBridgeServiceForTesting( |
62 std::unique_ptr<ArcBridgeService> arc_bridge_service); | 59 std::unique_ptr<ArcBridgeService> arc_bridge_service); |
63 | 60 |
64 // Returns the icon loader owned by ArcServiceManager and shared by services. | 61 // Returns the icon loader owned by ArcServiceManager and shared by services. |
65 scoped_refptr<ActivityIconLoader> icon_loader() { return icon_loader_; } | 62 scoped_refptr<ActivityIconLoader> icon_loader() { return icon_loader_; } |
66 | 63 |
67 // Returns the activity resolver owned by ArcServiceManager. | 64 // Returns the activity resolver owned by ArcServiceManager. |
68 scoped_refptr<LocalActivityResolver> activity_resolver() { | 65 scoped_refptr<LocalActivityResolver> activity_resolver() { |
69 return activity_resolver_; | 66 return activity_resolver_; |
70 } | 67 } |
71 | 68 |
72 private: | 69 private: |
73 base::ThreadChecker thread_checker_; | 70 base::ThreadChecker thread_checker_; |
74 scoped_refptr<base::TaskRunner> blocking_task_runner_; | 71 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
75 | 72 |
76 std::unique_ptr<ArcBridgeService> arc_bridge_service_; | 73 std::unique_ptr<ArcBridgeService> arc_bridge_service_; |
77 std::vector<std::unique_ptr<ArcService>> services_; | 74 std::vector<std::unique_ptr<ArcService>> services_; |
78 scoped_refptr<ActivityIconLoader> icon_loader_; | 75 scoped_refptr<ActivityIconLoader> icon_loader_; |
79 scoped_refptr<LocalActivityResolver> activity_resolver_; | 76 scoped_refptr<LocalActivityResolver> activity_resolver_; |
80 | 77 |
81 // True once the window manager service got added, barring adding any more | |
82 // of those since OnAshStarted() might be called multiple times. | |
83 bool on_ash_started_called_ = false; | |
84 | |
85 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); | 78 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); |
86 }; | 79 }; |
87 | 80 |
88 } // namespace arc | 81 } // namespace arc |
89 | 82 |
90 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 83 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
OLD | NEW |