Chromium Code Reviews| 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 58b78925f742f6f6f9376befe5ad1068925c4165..960f3aee6ae0a85e39b412861b033a38aad3b907 100644 |
| --- a/components/arc/intent_helper/activity_icon_loader.h |
| +++ b/components/arc/intent_helper/activity_icon_loader.h |
| @@ -12,11 +12,10 @@ |
| #include "base/callback.h" |
| #include "base/macros.h" |
| -#include "base/memory/ref_counted.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "base/threading/thread_checker.h" |
| #include "components/arc/arc_service.h" |
| #include "components/arc/common/intent_helper.mojom.h" |
| -#include "components/arc/intent_helper/arc_intent_helper_bridge.h" |
| #include "ui/base/layout.h" |
| #include "ui/gfx/image/image.h" |
| #include "url/gurl.h" |
| @@ -24,7 +23,7 @@ |
| namespace arc { |
| // A class which retrieves an activity icon from ARC. |
| -class ActivityIconLoader : public base::RefCounted<ActivityIconLoader> { |
| +class ActivityIconLoader { |
| public: |
| struct Icons { |
| Icons(const gfx::Image& icon16, const gfx::Image& icon20, |
| @@ -69,6 +68,7 @@ class ActivityIconLoader : public base::RefCounted<ActivityIconLoader> { |
| base::Callback<void(std::unique_ptr<ActivityToIconsMap>)>; |
| ActivityIconLoader(); |
| + ~ActivityIconLoader(); |
| // Removes icons associated with |package_name| from the cache. |
| void InvalidateIcons(const std::string& package_name); |
| @@ -92,18 +92,11 @@ class ActivityIconLoader : public base::RefCounted<ActivityIconLoader> { |
| const ActivityToIconsMap& cached_icons_for_testing() { return cached_icons_; } |
| private: |
| - friend class base::RefCounted<ActivityIconLoader>; |
| - ~ActivityIconLoader(); |
| - |
| // A function called when the mojo IPC returns. |
| void OnIconsReady(std::unique_ptr<ActivityToIconsMap> cached_result, |
| const OnIconsReadyCallback& cb, |
| std::vector<mojom::ActivityIconPtr> icons); |
| - // Resizes and encodes |icons| and returns the results as ActivityToIconsMap. |
| - static std::unique_ptr<ActivityToIconsMap> ResizeAndEncodeIcons( |
| - std::vector<mojom::ActivityIconPtr> icons); |
| - |
| // A function called when ResizeIcons finishes. Append items in |result| to |
| // |cached_icons_|. |
| void OnIconsResized(std::unique_ptr<ActivityToIconsMap> cached_result, |
| @@ -117,6 +110,7 @@ class ActivityIconLoader : public base::RefCounted<ActivityIconLoader> { |
| base::ThreadChecker thread_checker_; |
| + base::WeakPtrFactory<ActivityIconLoader> weak_ptr_factory_; |
|
Yusuke Sato
2017/01/27 18:21:17
nit: Can you add the usual comment '// this member
hidehiko
2017/01/30 17:04:03
Done.
|
| DISALLOW_COPY_AND_ASSIGN(ActivityIconLoader); |
|
Yusuke Sato
2017/01/27 18:21:17
nit: space between L113/114?
hidehiko
2017/01/30 17:04:03
Done.
|
| }; |