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

Unified Diff: components/arc/arc_service_manager.h

Issue 2487623002: Notify Files App when ARC++ app is installed/removed (Closed)
Patch Set: Bug fix: I forgot to add intent_helper to arc_service_manager. Created 4 years, 1 month 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
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..dfa0e84ed258b6938ac29c0db3d4b8c67a67640b 100644
--- a/components/arc/arc_service_manager.h
+++ b/components/arc/arc_service_manager.h
@@ -13,6 +13,7 @@
#include "base/task_runner.h"
hidehiko 2016/11/25 15:38:00 #include "base/observer_list.h" looks missing.
oka 2016/11/28 07:15:43 Done.
#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 +25,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 {
hidehiko 2016/11/25 15:38:00 I think this line can be merged with above one. Co
oka 2016/11/28 07:15:43 Done.
public:
+ class Observer {
+ public:
+ // Called when app's intent filter is updated.
+ virtual void OnAppsUpdated() = 0;
+ protected:
+ virtual ~Observer() {}
hidehiko 2016/11/25 15:38:00 s/{}/= default;
oka 2016/11/28 07:15:43 Done.
+ };
+
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 +56,12 @@ class ArcServiceManager {
const AccountId& account_id,
std::unique_ptr<BooleanPrefMember> arc_enabled_pref);
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ // arc::ArcIntentHelperBridge::Observer overrides.
+ void OnAppsUpdated() override;
+
// Called to shut down all ARC services.
void Shutdown();
@@ -75,6 +91,8 @@ class ArcServiceManager {
scoped_refptr<ActivityIconLoader> icon_loader_;
scoped_refptr<LocalActivityResolver> activity_resolver_;
+ base::ObserverList<Observer> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(ArcServiceManager);
};

Powered by Google App Engine
This is Rietveld 408576698