Chromium Code Reviews| Index: components/arc/intent_helper/arc_intent_helper_bridge.cc |
| diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.cc b/components/arc/intent_helper/arc_intent_helper_bridge.cc |
| index eae327e796ebed0849ee3b2c21ac07b65a1e27af..b012c099a6cc23a20f20908c7ba57d7ba5524ac2 100644 |
| --- a/components/arc/intent_helper/arc_intent_helper_bridge.cc |
| +++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc |
| @@ -15,7 +15,6 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "components/arc/arc_bridge_service.h" |
| #include "components/arc/arc_service_manager.h" |
| -#include "components/arc/intent_helper/activity_icon_loader.h" |
| #include "components/arc/intent_helper/link_handler_model_impl.h" |
| #include "components/arc/intent_helper/local_activity_resolver.h" |
| #include "ui/base/layout.h" |
| @@ -33,11 +32,9 @@ const char ArcIntentHelperBridge::kArcIntentHelperPackageName[] = |
| ArcIntentHelperBridge::ArcIntentHelperBridge( |
| ArcBridgeService* bridge_service, |
| - const scoped_refptr<ActivityIconLoader>& icon_loader, |
| const scoped_refptr<LocalActivityResolver>& activity_resolver) |
| : ArcService(bridge_service), |
| binding_(this), |
| - icon_loader_(icon_loader), |
| activity_resolver_(activity_resolver) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| arc_bridge_service()->intent_helper()->AddObserver(this); |
| @@ -64,7 +61,7 @@ void ArcIntentHelperBridge::OnInstanceClosed() { |
| void ArcIntentHelperBridge::OnIconInvalidated(const std::string& package_name) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - icon_loader_->InvalidateIcons(package_name); |
| + icon_loader_.InvalidateIcons(package_name); |
| } |
| void ArcIntentHelperBridge::OnOpenDownloads() { |
| @@ -92,6 +89,13 @@ void ArcIntentHelperBridge::SetWallpaperDeprecated( |
| LOG(ERROR) << "IntentHelper.SetWallpaper is deprecated"; |
| } |
| +ArcIntentHelperBridge::GetResult ArcIntentHelperBridge::GetActivityIcons( |
| + const std::vector<ActivityName>& activities, |
| + const OnIconsReadyCallback& callback) { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + return icon_loader_.GetActivityIcons(activities, callback); |
| +} |
| + |
| void ArcIntentHelperBridge::AddObserver(ArcIntentHelperObserver* observer) { |
| observer_list_.AddObserver(observer); |
| } |
| @@ -103,8 +107,7 @@ void ArcIntentHelperBridge::RemoveObserver(ArcIntentHelperObserver* observer) { |
| std::unique_ptr<ash::LinkHandlerModel> ArcIntentHelperBridge::CreateModel( |
| const GURL& url) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - std::unique_ptr<LinkHandlerModelImpl> impl( |
| - new LinkHandlerModelImpl(icon_loader_)); |
| + auto impl = base::MakeUnique<LinkHandlerModelImpl>(); |
| if (!impl->Init(url)) |
| return nullptr; |
| return std::move(impl); |
| @@ -129,34 +132,6 @@ ArcIntentHelperBridge::FilterOutIntentHelper( |
| return handlers_filtered; |
| } |
| -// static |
| -bool ArcIntentHelperBridge::IsIntentHelperAvailable(GetResult* out_error_code) { |
|
hidehiko
2017/01/30 17:04:03
Merged into GetInstanceForRequestActivityIcons() i
|
| - auto* arc_service_manager = ArcServiceManager::Get(); |
| - if (!arc_service_manager) { |
| - if (!ArcBridgeService::GetEnabled(base::CommandLine::ForCurrentProcess())) { |
| - VLOG(2) << "ARC bridge is not supported."; |
| - if (out_error_code) |
| - *out_error_code = GetResult::FAILED_ARC_NOT_SUPPORTED; |
| - } else { |
| - VLOG(2) << "ARC bridge is not ready."; |
| - if (out_error_code) |
| - *out_error_code = GetResult::FAILED_ARC_NOT_READY; |
| - } |
| - return false; |
| - } |
| - |
| - auto* intent_helper_holder = |
| - arc_service_manager->arc_bridge_service()->intent_helper(); |
| - if (!intent_helper_holder->has_instance()) { |
| - VLOG(2) << "ARC intent helper instance is not ready."; |
| - if (out_error_code) |
| - *out_error_code = GetResult::FAILED_ARC_NOT_READY; |
| - return false; |
| - } |
| - |
| - return true; |
| -} |
| - |
| void ArcIntentHelperBridge::OnIntentFiltersUpdated( |
| std::vector<IntentFilter> filters) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |