| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| 11 #include "components/signin/core/account_id/account_id.h" | 11 #include "components/signin/core/account_id/account_id.h" |
| 12 | 12 |
| 13 namespace arc { | 13 namespace arc { |
| 14 | 14 |
| 15 class ArcAuthService; | 15 class ArcAuthService; |
| 16 class ArcBridgeService; | 16 class ArcBridgeService; |
| 17 class ArcClipboardBridge; | 17 class ArcClipboardBridge; |
| 18 class ArcInputBridge; | 18 class ArcInputBridge; |
| 19 class ArcIntentHelperBridge; |
| 19 class ArcNotificationManager; | 20 class ArcNotificationManager; |
| 20 class ArcPowerBridge; | 21 class ArcPowerBridge; |
| 21 class ArcSettingsBridge; | 22 class ArcSettingsBridge; |
| 22 class ArcVideoBridge; | 23 class ArcVideoBridge; |
| 23 | 24 |
| 24 // Manages creation and destruction of services that communicate with the ARC | 25 // Manages creation and destruction of services that communicate with the ARC |
| 25 // instance via the ArcBridgeService. | 26 // instance via the ArcBridgeService. |
| 26 class ArcServiceManager { | 27 class ArcServiceManager { |
| 27 public: | 28 public: |
| 28 ArcServiceManager(scoped_ptr<ArcAuthService> auth_service, | 29 ArcServiceManager(scoped_ptr<ArcAuthService> auth_service, |
| 30 scoped_ptr<ArcIntentHelperBridge> intent_helper_bridge, |
| 29 scoped_ptr<ArcSettingsBridge> settings_bridge, | 31 scoped_ptr<ArcSettingsBridge> settings_bridge, |
| 30 scoped_ptr<ArcVideoBridge> video_bridge); | 32 scoped_ptr<ArcVideoBridge> video_bridge); |
| 31 virtual ~ArcServiceManager(); | 33 virtual ~ArcServiceManager(); |
| 32 | 34 |
| 33 // |arc_bridge_service| can only be accessed on the thread that this | 35 // |arc_bridge_service| can only be accessed on the thread that this |
| 34 // class was created on. | 36 // class was created on. |
| 35 ArcBridgeService* arc_bridge_service(); | 37 ArcBridgeService* arc_bridge_service(); |
| 36 | 38 |
| 37 // Gets the global instance of the ARC Service Manager. This can only be | 39 // Gets the global instance of the ARC Service Manager. This can only be |
| 38 // called on the thread that this class was created on. | 40 // called on the thread that this class was created on. |
| 39 static ArcServiceManager* Get(); | 41 static ArcServiceManager* Get(); |
| 40 | 42 |
| 41 // Called when the main profile is initialized after user logs in. | 43 // Called when the main profile is initialized after user logs in. |
| 42 void OnPrimaryUserProfilePrepared(const AccountId& account_id); | 44 void OnPrimaryUserProfilePrepared(const AccountId& account_id); |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 base::ThreadChecker thread_checker_; | 47 base::ThreadChecker thread_checker_; |
| 46 scoped_ptr<ArcBridgeService> arc_bridge_service_; | 48 scoped_ptr<ArcBridgeService> arc_bridge_service_; |
| 47 | 49 |
| 48 // Individual services | 50 // Individual services |
| 49 scoped_ptr<ArcAuthService> arc_auth_service_; | 51 scoped_ptr<ArcAuthService> arc_auth_service_; |
| 50 scoped_ptr<ArcClipboardBridge> arc_clipboard_bridge_; | 52 scoped_ptr<ArcClipboardBridge> arc_clipboard_bridge_; |
| 51 scoped_ptr<ArcInputBridge> arc_input_bridge_; | 53 scoped_ptr<ArcInputBridge> arc_input_bridge_; |
| 54 scoped_ptr<ArcIntentHelperBridge> arc_intent_helper_bridge_; |
| 52 scoped_ptr<ArcNotificationManager> arc_notification_manager_; | 55 scoped_ptr<ArcNotificationManager> arc_notification_manager_; |
| 53 scoped_ptr<ArcSettingsBridge> arc_settings_bridge_; | 56 scoped_ptr<ArcSettingsBridge> arc_settings_bridge_; |
| 54 scoped_ptr<ArcPowerBridge> arc_power_bridge_; | 57 scoped_ptr<ArcPowerBridge> arc_power_bridge_; |
| 55 scoped_ptr<ArcVideoBridge> arc_video_bridge_; | 58 scoped_ptr<ArcVideoBridge> arc_video_bridge_; |
| 56 | 59 |
| 57 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); | 60 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 } // namespace arc | 63 } // namespace arc |
| 61 | 64 |
| 62 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 65 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| OLD | NEW |