Index: chrome/browser/chromeos/extensions/file_manager/event_router.cc |
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc |
index fe12c7bc18667d6e31f32679552819b7d5d7a3e4..7ce2f1c684b42546122400926e87b083df0a7219 100644 |
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc |
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc |
@@ -412,8 +412,10 @@ void EventRouter::OnIntentFiltersUpdated() { |
void EventRouter::Shutdown() { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
- if (arc::ArcServiceManager::IsInitialized()) |
- arc::ArcServiceManager::Get()->RemoveObserver(this); |
+ auto* intent_helper = |
+ arc::ArcServiceManager::GetGlobalService<arc::ArcIntentHelperBridge>(); |
+ if (intent_helper) |
+ intent_helper->RemoveObserver(this); |
chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this); |
@@ -506,8 +508,12 @@ void EventRouter::ObserveEvents() { |
chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this); |
- if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) |
- arc::ArcServiceManager::Get()->AddObserver(this); |
+ if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) { |
+ auto* intent_helper = |
+ arc::ArcServiceManager::GetGlobalService<arc::ArcIntentHelperBridge>(); |
+ if (intent_helper) |
+ intent_helper->AddObserver(this); |
+ } |
} |
// File watch setup routines. |