| 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..fbe3db02dbf222585d133ea812f3ab5415079f9c 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;
|
| + std::vector<ArcIntentHelperBridge::ActivityName> activities;
|
| for (const auto& handler : handlers)
|
| activities.emplace_back(handler->package_name, handler->activity_name);
|
| - icon_loader->GetActivityIcons(
|
| + intent_helper_bridge->GetActivityIcons(
|
| activities,
|
| base::Bind(&ArcNavigationThrottle::OnAppIconsReceived,
|
| weak_ptr_factory_.GetWeakPtr(), base::Passed(&handlers)));
|
| @@ -264,14 +259,14 @@ void ArcNavigationThrottle::OnAppCandidatesReceived(
|
|
|
| void ArcNavigationThrottle::OnAppIconsReceived(
|
| std::vector<mojom::IntentHandlerInfoPtr> handlers,
|
| - std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> icons) {
|
| + std::unique_ptr<ArcIntentHelperBridge::ActivityToIconsMap> icons) {
|
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| std::vector<AppInfo> app_info;
|
|
|
| for (const auto& handler : handlers) {
|
| gfx::Image icon;
|
| - const ActivityIconLoader::ActivityName activity(handler->package_name,
|
| - handler->activity_name);
|
| + const ArcIntentHelperBridge::ActivityName activity(handler->package_name,
|
| + handler->activity_name);
|
| const auto it = icons->find(activity);
|
|
|
| app_info.emplace_back(
|
|
|