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

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

Issue 2623273003: arc: Remove ArcServiceManager::Observer (Closed)
Patch Set: fix tests, review 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
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..0f60688df2fb968885e407013f01424a5106e612 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::ArcIntentHelperBridge::Get(arc::ArcServiceManager::Get());
+ 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::ArcIntentHelperBridge::Get(arc::ArcServiceManager::Get());
+ if (intent_helper_bridge)
+ intent_helper_bridge->RemoveObserver(this);
if (arc::ArcSessionManager::Get())
arc::ArcSessionManager::Get()->RemoveObserver(this);
}

Powered by Google App Engine
This is Rietveld 408576698