| Index: components/arc/intent_helper/activity_icon_loader.cc
|
| diff --git a/components/arc/intent_helper/activity_icon_loader.cc b/components/arc/intent_helper/activity_icon_loader.cc
|
| index a0d74f5158f855bc8aced747ed7522e6e715c139..d83b6a1da1bca4c3641d31da24959ae96be20d1b 100644
|
| --- a/components/arc/intent_helper/activity_icon_loader.cc
|
| +++ b/components/arc/intent_helper/activity_icon_loader.cc
|
| @@ -28,14 +28,27 @@ constexpr size_t kLargeIconSizeInDip = 20;
|
| constexpr size_t kMaxIconSizeInPx = 200;
|
| constexpr char kPngDataUrlPrefix[] = "data:image/png;base64,";
|
|
|
| -constexpr int kMinInstanceVersion = 3; // see intent_helper.mojom
|
| -
|
| ui::ScaleFactor GetSupportedScaleFactor() {
|
| std::vector<ui::ScaleFactor> scale_factors = ui::GetSupportedScaleFactors();
|
| DCHECK(!scale_factors.empty());
|
| return scale_factors.back();
|
| }
|
|
|
| +// Returns an instance for calling RequestActivityIcons().
|
| +mojom::IntentHelperInstance* GetInstanceForRequestActivityIcons(
|
| + ArcIntentHelperBridge::GetResult* out_error_code) {
|
| + if (!ArcIntentHelperBridge::IsIntentHelperAvailable(out_error_code))
|
| + return nullptr;
|
| + auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
|
| + ArcServiceManager::Get()->arc_bridge_service()->intent_helper(),
|
| + RequestActivityIcons);
|
| + if (!instance && out_error_code) {
|
| + *out_error_code =
|
| + ArcIntentHelperBridge::GetResult::FAILED_ARC_NOT_SUPPORTED;
|
| + }
|
| + return instance;
|
| +}
|
| +
|
| } // namespace
|
|
|
| ActivityIconLoader::Icons::Icons(
|
| @@ -97,8 +110,7 @@ ActivityIconLoader::GetResult ActivityIconLoader::GetActivityIcons(
|
| }
|
|
|
| ArcIntentHelperBridge::GetResult error_code;
|
| - auto* instance = ArcIntentHelperBridge::GetIntentHelperInstanceWithErrorCode(
|
| - "RequestActivityIcons", kMinInstanceVersion, &error_code);
|
| + auto* instance = GetInstanceForRequestActivityIcons(&error_code);
|
| if (!instance) {
|
| // The mojo channel is not yet ready (or not supported at all). Run the
|
| // callback with |result| that could be empty.
|
|
|