Index: components/arc/arc_service_manager.h |
diff --git a/components/arc/arc_service_manager.h b/components/arc/arc_service_manager.h |
index 256a1992eb906e9eeac10793e6c46e492ab53e8b..dcf36a5040e3e3f5bff90f69b294963c54fddd31 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" |
#include "components/prefs/pref_member.h" |
#include "components/signin/core/account_id/account_id.h" |
@@ -24,11 +26,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. |
@@ -46,6 +57,12 @@ class ArcServiceManager { |
const AccountId& account_id, |
std::unique_ptr<BooleanPrefMember> arc_enabled_pref); |
+ void AddObserver(Observer* observer); |
+ void RemoveObserver(Observer* observer); |
+ |
+ // arc::ArcIntentHelperObserver overrides. |
+ void OnAppsUpdated() override; |
+ |
// Called to shut down all ARC services. |
void Shutdown(); |
@@ -75,6 +92,8 @@ class ArcServiceManager { |
scoped_refptr<ActivityIconLoader> icon_loader_; |
scoped_refptr<LocalActivityResolver> activity_resolver_; |
+ base::ObserverList<Observer> observer_list_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); |
}; |