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

Unified Diff: chrome/browser/chromeos/note_taking_helper.cc

Issue 2623273003: arc: Remove ArcServiceManager::Observer (Closed)
Patch Set: Moved Get() to the manager class per (verbal) feedback from Luis 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/note_taking_helper.h ('k') | components/arc/arc_service_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/note_taking_helper.cc
diff --git a/chrome/browser/chromeos/note_taking_helper.cc b/chrome/browser/chromeos/note_taking_helper.cc
index d4b56f297059c22cd236c811f40ef82b53d8fabc..95c7594d6d2d14368abd0235351ca5e1bd413718 100644
--- a/chrome/browser/chromeos/note_taking_helper.cc
+++ b/chrome/browser/chromeos/note_taking_helper.cc
@@ -26,7 +26,7 @@
#include "chromeos/chromeos_switches.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_service_manager.h"
-#include "components/arc/common/intent_helper.mojom.h"
+#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -228,10 +228,12 @@ NoteTakingHelper::NoteTakingHelper()
session_manager->AddObserver(this);
android_enabled_ = session_manager->IsArcEnabled();
- // ArcServiceManager will notify us about changes to the list of available
+ // ArcIntentHelperBridge will notify us about changes to the list of available
// Android apps.
- auto service_manager = arc::ArcServiceManager::Get();
- service_manager->AddObserver(this);
+ auto intent_helper_bridge =
+ arc::ArcServiceManager::GetGlobalService<arc::ArcIntentHelperBridge>();
+ if (intent_helper_bridge)
+ intent_helper_bridge->AddObserver(this);
// If the ARC intent helper is ready, get the Android apps. Otherwise,
// UpdateAndroidApps() will be called when ArcServiceManager calls
@@ -248,8 +250,10 @@ NoteTakingHelper::~NoteTakingHelper() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// ArcSessionManagerTest shuts down ARC before NoteTakingHelper.
- if (arc::ArcServiceManager::Get())
- arc::ArcServiceManager::Get()->RemoveObserver(this);
+ auto intent_helper_bridge =
+ arc::ArcServiceManager::GetGlobalService<arc::ArcIntentHelperBridge>();
+ if (intent_helper_bridge)
+ intent_helper_bridge->RemoveObserver(this);
if (arc::ArcSessionManager::Get())
arc::ArcSessionManager::Get()->RemoveObserver(this);
}
« no previous file with comments | « chrome/browser/chromeos/note_taking_helper.h ('k') | components/arc/arc_service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698