| Index: components/arc/intent_helper/link_handler_model_impl.cc
|
| diff --git a/components/arc/intent_helper/link_handler_model_impl.cc b/components/arc/intent_helper/link_handler_model_impl.cc
|
| index 19485e179ffcf22ad22dc6a749b21fe923c4227b..b4c7c7d6bcb9f0b79dddafeb4751ad59b64361d4 100644
|
| --- a/components/arc/intent_helper/link_handler_model_impl.cc
|
| +++ b/components/arc/intent_helper/link_handler_model_impl.cc
|
| @@ -12,7 +12,6 @@
|
| #include "components/arc/arc_service_manager.h"
|
| #include "components/arc/intent_helper/arc_intent_helper_bridge.h"
|
| #include "components/google/core/browser/google_util.h"
|
| -#include "url/gurl.h"
|
| #include "url/url_util.h"
|
|
|
| namespace arc {
|
| @@ -48,11 +47,9 @@ bool GetQueryValue(const GURL& url,
|
|
|
| } // namespace
|
|
|
| -LinkHandlerModelImpl::LinkHandlerModelImpl(
|
| - scoped_refptr<ActivityIconLoader> icon_loader)
|
| - : icon_loader_(icon_loader), weak_ptr_factory_(this) {}
|
| +LinkHandlerModelImpl::LinkHandlerModelImpl() : weak_ptr_factory_(this) {}
|
|
|
| -LinkHandlerModelImpl::~LinkHandlerModelImpl() {}
|
| +LinkHandlerModelImpl::~LinkHandlerModelImpl() = default;
|
|
|
| bool LinkHandlerModelImpl::Init(const GURL& url) {
|
| auto* arc_service_manager = ArcServiceManager::Get();
|
| @@ -99,16 +96,20 @@ void LinkHandlerModelImpl::OnUrlHandlerList(
|
| handlers_ = ArcIntentHelperBridge::FilterOutIntentHelper(std::move(handlers));
|
|
|
| bool icon_info_notified = false;
|
| - if (icon_loader_) {
|
| - std::vector<ActivityIconLoader::ActivityName> activities;
|
| + auto* intent_helper_bridge =
|
| + ArcServiceManager::GetGlobalService<ArcIntentHelperBridge>();
|
| + if (intent_helper_bridge) {
|
| + std::vector<ArcIntentHelperBridge::ActivityName> activities;
|
| for (size_t i = 0; i < handlers_.size(); ++i) {
|
| activities.emplace_back(handlers_[i]->package_name,
|
| handlers_[i]->activity_name);
|
| }
|
| - const ActivityIconLoader::GetResult result = icon_loader_->GetActivityIcons(
|
| - activities, base::Bind(&LinkHandlerModelImpl::NotifyObserver,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| - icon_info_notified = ActivityIconLoader::HasIconsReadyCallbackRun(result);
|
| + const ArcIntentHelperBridge::GetResult result =
|
| + intent_helper_bridge->GetActivityIcons(
|
| + activities, base::Bind(&LinkHandlerModelImpl::NotifyObserver,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| + icon_info_notified =
|
| + internal::ActivityIconLoader::HasIconsReadyCallbackRun(result);
|
| }
|
|
|
| if (!icon_info_notified) {
|
| @@ -120,7 +121,7 @@ void LinkHandlerModelImpl::OnUrlHandlerList(
|
| }
|
|
|
| void LinkHandlerModelImpl::NotifyObserver(
|
| - std::unique_ptr<ActivityIconLoader::ActivityToIconsMap> icons) {
|
| + std::unique_ptr<ArcIntentHelperBridge::ActivityToIconsMap> icons) {
|
| if (icons) {
|
| icons_.insert(icons->begin(), icons->end());
|
| icons.reset();
|
| @@ -129,7 +130,7 @@ void LinkHandlerModelImpl::NotifyObserver(
|
| std::vector<ash::LinkHandlerInfo> handlers;
|
| for (size_t i = 0; i < handlers_.size(); ++i) {
|
| gfx::Image icon;
|
| - const ActivityIconLoader::ActivityName activity(
|
| + const ArcIntentHelperBridge::ActivityName activity(
|
| handlers_[i]->package_name, handlers_[i]->activity_name);
|
| const auto it = icons_.find(activity);
|
| if (it != icons_.end())
|
|
|