| Index: components/arc/intent_helper/activity_icon_loader.h
|
| diff --git a/components/arc/intent_helper/activity_icon_loader.h b/components/arc/intent_helper/activity_icon_loader.h
|
| index 41d2ace9640a7a63f950b7199d965c3ce36fb3a2..75611ace67d19ed5c254596ae9d6641b553e2a86 100644
|
| --- a/components/arc/intent_helper/activity_icon_loader.h
|
| +++ b/components/arc/intent_helper/activity_icon_loader.h
|
| @@ -44,6 +44,19 @@ class ActivityIconLoader : public base::RefCounted<ActivityIconLoader> {
|
| std::string activity_name;
|
| };
|
|
|
| + enum class GetResult {
|
| + // Succeeded. The callback will be called asynchronously.
|
| + SUCCEEDED_ASYNC,
|
| + // Succeeded. The callback has already been called synchronously.
|
| + SUCCEEDED_SYNC,
|
| + // Failed. The intent_helper instance is not yet ready. This is a temporary
|
| + // error.
|
| + FAILED_ARC_NOT_READY,
|
| + // Failed. Either ARC is not supported at all or intent_helper instance
|
| + // version is too old.
|
| + FAILED_ARC_NOT_SUPPORTED,
|
| + };
|
| +
|
| using ActivityToIconsMap = std::map<ActivityName, Icons>;
|
| using OnIconsReadyCallback =
|
| base::Callback<void(std::unique_ptr<ActivityToIconsMap>)>;
|
| @@ -57,9 +70,8 @@ class ActivityIconLoader : public base::RefCounted<ActivityIconLoader> {
|
| // back exactly once, either synchronously in the GetActivityIcons() when
|
| // all icons were already cached locally, or asynchronously with icons fetched
|
| // from ARC side.
|
| - // Returns true in the former synchronous case, where everything is done.
|
| - bool GetActivityIcons(const std::vector<ActivityName>& activities,
|
| - const OnIconsReadyCallback& cb);
|
| + GetResult GetActivityIcons(const std::vector<ActivityName>& activities,
|
| + const OnIconsReadyCallback& cb);
|
|
|
| void OnIconsResizedForTesting(const OnIconsReadyCallback& cb,
|
| std::unique_ptr<ActivityToIconsMap> result);
|
|
|