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

Unified Diff: components/arc/arc_service_manager.h

Issue 2487623002: Notify Files App when ARC++ app is installed/removed (Closed)
Patch Set: Add IsInitialized to arc_service_manager. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/file_manager_private.idl ('k') | components/arc/arc_service_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_service_manager.h
diff --git a/components/arc/arc_service_manager.h b/components/arc/arc_service_manager.h
index 57a00cce6fcb3214358c9a269bc2097714580a1c..dac67e90d86e52aec755bbf31084e1f9e716c57b 100644
--- a/components/arc/arc_service_manager.h
+++ b/components/arc/arc_service_manager.h
@@ -10,9 +10,11 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/observer_list.h"
#include "base/task_runner.h"
#include "base/threading/thread_checker.h"
#include "components/arc/intent_helper/activity_icon_loader.h"
+#include "components/arc/intent_helper/arc_intent_helper_observer.h"
#include "components/arc/intent_helper/local_activity_resolver.h"
namespace arc {
@@ -22,11 +24,20 @@ class ArcService;
// Manages creation and destruction of services that communicate with the ARC
// instance via the ArcBridgeService.
-class ArcServiceManager {
+class ArcServiceManager : public arc::ArcIntentHelperObserver {
public:
+ class Observer {
+ public:
+ // Called when app's intent filter is updated.
+ virtual void OnAppsUpdated() = 0;
+
+ protected:
+ virtual ~Observer() = default;
+ };
+
explicit ArcServiceManager(
scoped_refptr<base::TaskRunner> blocking_task_runner);
- virtual ~ArcServiceManager();
+ ~ArcServiceManager() override;
// |arc_bridge_service| can only be accessed on the thread that this
// class was created on.
@@ -39,6 +50,15 @@ class ArcServiceManager {
// called on the thread that this class was created on.
static ArcServiceManager* Get();
+ // Returns if the ARC Service Manager instance exists.
+ static bool IsInitialized();
+
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ // arc::ArcIntentHelperObserver overrides.
+ void OnAppsUpdated() override;
+
// Called to shut down all ARC services.
void Shutdown();
@@ -68,6 +88,8 @@ class ArcServiceManager {
scoped_refptr<ActivityIconLoader> icon_loader_;
scoped_refptr<LocalActivityResolver> activity_resolver_;
+ base::ObserverList<Observer> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(ArcServiceManager);
};
« no previous file with comments | « chrome/common/extensions/api/file_manager_private.idl ('k') | components/arc/arc_service_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698