Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: components/arc/arc_service_manager.h

Issue 1618193003: arc: Pass auth token from Chrome to ARC instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor formating Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 class Profile;
14
13 namespace arc { 15 namespace arc {
14 16
15 class ArcAuthService; 17 class ArcAuthService;
16 class ArcBridgeService; 18 class ArcBridgeService;
17 class ArcClipboardBridge; 19 class ArcClipboardBridge;
18 class ArcImeBridge; 20 class ArcImeBridge;
19 class ArcInputBridge; 21 class ArcInputBridge;
20 class ArcIntentHelperBridge; 22 class ArcIntentHelperBridge;
21 class ArcNotificationManager; 23 class ArcNotificationManager;
24 class ArcOptInManager;
22 class ArcPowerBridge; 25 class ArcPowerBridge;
23 class ArcSettingsBridge; 26 class ArcSettingsBridge;
24 class ArcVideoBridge; 27 class ArcVideoBridge;
25 28
26 // Manages creation and destruction of services that communicate with the ARC 29 // Manages creation and destruction of services that communicate with the ARC
27 // instance via the ArcBridgeService. 30 // instance via the ArcBridgeService.
28 class ArcServiceManager { 31 class ArcServiceManager {
29 public: 32 public:
30 ArcServiceManager(scoped_ptr<ArcAuthService> auth_service, 33 ArcServiceManager(scoped_ptr<ArcOptInManager> opt_in_manager,
34 scoped_ptr<ArcAuthService> auth_service,
lhc(google) 2016/01/22 22:18:33 Please rebase, this interface changed. Now you nee
khmel 2016/01/23 00:41:43 Rebased. Also moved code to ArcAuthService.
31 scoped_ptr<ArcIntentHelperBridge> intent_helper_bridge, 35 scoped_ptr<ArcIntentHelperBridge> intent_helper_bridge,
32 scoped_ptr<ArcSettingsBridge> settings_bridge, 36 scoped_ptr<ArcSettingsBridge> settings_bridge,
33 scoped_ptr<ArcVideoBridge> video_bridge); 37 scoped_ptr<ArcVideoBridge> video_bridge);
34 virtual ~ArcServiceManager(); 38 virtual ~ArcServiceManager();
35 39
36 // |arc_bridge_service| can only be accessed on the thread that this 40 // |arc_bridge_service| can only be accessed on the thread that this
37 // class was created on. 41 // class was created on.
38 ArcBridgeService* arc_bridge_service(); 42 ArcBridgeService* arc_bridge_service();
39 43
44 ArcOptInManager* arc_opt_in_manager() { return arc_opt_in_manager_.get(); }
45
40 // Gets the global instance of the ARC Service Manager. This can only be 46 // Gets the global instance of the ARC Service Manager. This can only be
41 // called on the thread that this class was created on. 47 // called on the thread that this class was created on.
42 static ArcServiceManager* Get(); 48 static ArcServiceManager* Get();
43 49
44 // Called when the main profile is initialized after user logs in. 50 // Called when the main profile is initialized after user logs in.
45 void OnPrimaryUserProfilePrepared(const AccountId& account_id); 51 void SetProfileAndAccountId(Profile* profile, const AccountId& account_id);
46 52
47 private: 53 private:
48 base::ThreadChecker thread_checker_; 54 base::ThreadChecker thread_checker_;
49 scoped_ptr<ArcBridgeService> arc_bridge_service_; 55 scoped_ptr<ArcBridgeService> arc_bridge_service_;
50 56
57 scoped_ptr<ArcOptInManager> arc_opt_in_manager_;
58
51 // Individual services 59 // Individual services
52 scoped_ptr<ArcAuthService> arc_auth_service_; 60 scoped_ptr<ArcAuthService> arc_auth_service_;
53 scoped_ptr<ArcClipboardBridge> arc_clipboard_bridge_; 61 scoped_ptr<ArcClipboardBridge> arc_clipboard_bridge_;
54 scoped_ptr<ArcImeBridge> arc_ime_bridge_; 62 scoped_ptr<ArcImeBridge> arc_ime_bridge_;
55 scoped_ptr<ArcInputBridge> arc_input_bridge_; 63 scoped_ptr<ArcInputBridge> arc_input_bridge_;
56 scoped_ptr<ArcIntentHelperBridge> arc_intent_helper_bridge_; 64 scoped_ptr<ArcIntentHelperBridge> arc_intent_helper_bridge_;
57 scoped_ptr<ArcNotificationManager> arc_notification_manager_; 65 scoped_ptr<ArcNotificationManager> arc_notification_manager_;
58 scoped_ptr<ArcSettingsBridge> arc_settings_bridge_; 66 scoped_ptr<ArcSettingsBridge> arc_settings_bridge_;
59 scoped_ptr<ArcPowerBridge> arc_power_bridge_; 67 scoped_ptr<ArcPowerBridge> arc_power_bridge_;
60 scoped_ptr<ArcVideoBridge> arc_video_bridge_; 68 scoped_ptr<ArcVideoBridge> arc_video_bridge_;
61 69
62 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); 70 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager);
63 }; 71 };
64 72
65 } // namespace arc 73 } // namespace arc
66 74
67 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ 75 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698