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