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

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

Issue 2596273002: Move ArcSessionRunner from ArcBridgeService to ArcSessionManager. (Closed)
Patch Set: Rebase and update comments. Created 3 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
« no previous file with comments | « components/arc/arc_bridge_service.cc ('k') | components/arc/arc_service_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "base/task_runner.h" 14 #include "base/task_runner.h"
15 #include "base/threading/thread_checker.h" 15 #include "base/threading/thread_checker.h"
16 #include "components/arc/intent_helper/activity_icon_loader.h" 16 #include "components/arc/intent_helper/activity_icon_loader.h"
17 #include "components/arc/intent_helper/local_activity_resolver.h" 17 #include "components/arc/intent_helper/local_activity_resolver.h"
18 18
19 namespace arc { 19 namespace arc {
20 20
21 class ArcBridgeService; 21 class ArcBridgeService;
22 class ArcIntentHelperObserver; 22 class ArcIntentHelperObserver;
23 class ArcService; 23 class ArcService;
24 class ArcSessionRunner;
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 class Observer { 29 class Observer {
31 public: 30 public:
32 // Called when ArcServiceManager is being shut down. Observer 31 // Called when ArcServiceManager is being shut down. Observer
33 // implementation should clean up ARC related stuff here. One of the 32 // implementation should clean up ARC related stuff here. One of the
34 // typical use cases is calling ArcServiceManager::RemoveObserver(). 33 // typical use cases is calling ArcServiceManager::RemoveObserver().
(...skipping 24 matching lines...) Expand all
59 void AddObserver(Observer* observer); 58 void AddObserver(Observer* observer);
60 void RemoveObserver(Observer* observer); 59 void RemoveObserver(Observer* observer);
61 60
62 // Called to shut down all ARC services. 61 // Called to shut down all ARC services.
63 void Shutdown(); 62 void Shutdown();
64 63
65 scoped_refptr<base::TaskRunner> blocking_task_runner() const { 64 scoped_refptr<base::TaskRunner> blocking_task_runner() const {
66 return blocking_task_runner_; 65 return blocking_task_runner_;
67 } 66 }
68 67
69 // Set ArcSessionRunner instance for testing. Call before ArcServiceManager
70 // creation.
71 static void SetArcSessionRunnerForTesting(
72 std::unique_ptr<ArcSessionRunner> arc_session_runner);
73
74 // Returns the icon loader owned by ArcServiceManager and shared by services. 68 // Returns the icon loader owned by ArcServiceManager and shared by services.
75 scoped_refptr<ActivityIconLoader> icon_loader() { return icon_loader_; } 69 scoped_refptr<ActivityIconLoader> icon_loader() { return icon_loader_; }
76 70
77 // Returns the activity resolver owned by ArcServiceManager. 71 // Returns the activity resolver owned by ArcServiceManager.
78 scoped_refptr<LocalActivityResolver> activity_resolver() { 72 scoped_refptr<LocalActivityResolver> activity_resolver() {
79 return activity_resolver_; 73 return activity_resolver_;
80 } 74 }
81 75
82 // Returns the IntentHelperObserver instance owned by ArcServiceManager. 76 // Returns the IntentHelperObserver instance owned by ArcServiceManager.
83 ArcIntentHelperObserver* intent_helper_observer() { 77 ArcIntentHelperObserver* intent_helper_observer() {
(...skipping 15 matching lines...) Expand all
99 scoped_refptr<LocalActivityResolver> activity_resolver_; 93 scoped_refptr<LocalActivityResolver> activity_resolver_;
100 94
101 base::ObserverList<Observer> observer_list_; 95 base::ObserverList<Observer> observer_list_;
102 96
103 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); 97 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager);
104 }; 98 };
105 99
106 } // namespace arc 100 } // namespace arc
107 101
108 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ 102 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_
OLDNEW
« no previous file with comments | « components/arc/arc_bridge_service.cc ('k') | components/arc/arc_service_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698