| Index: chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.cc
|
| diff --git a/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.cc b/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.cc
|
| index e009095994cc86f4b8d982079104ba81c4b53592..17a27ca9b1758bd292f8c234c792267e5c562bd5 100644
|
| --- a/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.cc
|
| +++ b/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.cc
|
| @@ -27,12 +27,6 @@ namespace arc {
|
|
|
| namespace {
|
|
|
| -scoped_refptr<ActivityIconLoader> GetIconLoader() {
|
| - DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| - ArcServiceManager* arc_service_manager = ArcServiceManager::Get();
|
| - return arc_service_manager ? arc_service_manager->icon_loader() : nullptr;
|
| -}
|
| -
|
| // Compares the host name of the referrer and target URL to decide whether
|
| // the navigation needs to be overriden.
|
| bool ShouldOverrideUrlLoading(const GURL& previous_url,
|
| @@ -247,16 +241,17 @@ void ArcNavigationThrottle::OnAppCandidatesReceived(
|
| if (IsSwapElementsNeeded(handlers, &indices))
|
| std::swap(handlers[indices.first], handlers[indices.second]);
|
|
|
| - scoped_refptr<ActivityIconLoader> icon_loader = GetIconLoader();
|
| - if (!icon_loader) {
|
| - LOG(ERROR) << "Cannot get an instance of ActivityIconLoader";
|
| + auto* intent_helper_bridge =
|
| + ArcServiceManager::GetGlobalService<ArcIntentHelperBridge>();
|
| + if (!intent_helper_bridge) {
|
| + LOG(ERROR) << "Cannot get an instance of ArcIntentHelperBridge";
|
| navigation_handle()->Resume();
|
| return;
|
| }
|
| std::vector<ActivityIconLoader::ActivityName> activities;
|
| for (const auto& handler : handlers)
|
| activities.emplace_back(handler->package_name, handler->activity_name);
|
| - icon_loader->GetActivityIcons(
|
| + intent_helper_bridge->icon_loader()->GetActivityIcons(
|
| activities,
|
| base::Bind(&ArcNavigationThrottle::OnAppIconsReceived,
|
| weak_ptr_factory_.GetWeakPtr(), base::Passed(&handlers)));
|
|
|