Chromium Code Reviews| Index: components/arc/intent_helper/arc_intent_helper_bridge.h |
| diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.h b/components/arc/intent_helper/arc_intent_helper_bridge.h |
| index cf3714e85675f7ba231aee497044e5274f696c87..d15dedff9e80579e0c6859682b1f8b35410477f8 100644 |
| --- a/components/arc/intent_helper/arc_intent_helper_bridge.h |
| +++ b/components/arc/intent_helper/arc_intent_helper_bridge.h |
| @@ -10,6 +10,9 @@ |
| #include "ash/link_handler_model_factory.h" |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/task_runner.h" |
| +#include "base/threading/thread_checker.h" |
| #include "components/arc/arc_bridge_service.h" |
| #include "components/arc/arc_service.h" |
| #include "components/arc/common/intent_helper.mojom.h" |
| @@ -21,9 +24,16 @@ class LinkHandlerModel; |
| } // namespace ash |
| +namespace gfx { |
| + |
| +class ImageSkia; |
| + |
| +} // namespace gfx |
| + |
| namespace arc { |
| class ActivityIconLoader; |
| +class SetWallpaperDelegate; |
| // Receives intents from ARC. |
| class ArcIntentHelperBridge : public ArcService, |
| @@ -31,8 +41,11 @@ class ArcIntentHelperBridge : public ArcService, |
| public mojom::IntentHelperHost, |
| public ash::LinkHandlerModelFactory { |
| public: |
| - ArcIntentHelperBridge(ArcBridgeService* bridge_service, |
| - const scoped_refptr<ActivityIconLoader>& icon_loader); |
| + ArcIntentHelperBridge( |
| + ArcBridgeService* bridge_service, |
| + const scoped_refptr<ActivityIconLoader>& icon_loader, |
| + const scoped_refptr<base::TaskRunner>& blocking_task_runner, |
| + std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate); |
| ~ArcIntentHelperBridge() override; |
| // ArcBridgeService::Observer |
| @@ -44,13 +57,24 @@ class ArcIntentHelperBridge : public ArcService, |
| void OnOpenDownloads() override; |
| void OnOpenUrl(const mojo::String& url) override; |
| void OpenWallpaperPicker() override; |
| + void SetWallpaper(mojo::Array<uint8_t> jpeg_data) override; |
| // ash::LinkHandlerModelFactory |
| std::unique_ptr<ash::LinkHandlerModel> CreateModel(const GURL& url) override; |
| private: |
| + void SetImageAsWallpaper(gfx::ImageSkia image); |
|
Yusuke Sato
2016/06/15 16:45:01
const reference did you mean? (although it's ref-c
Shuhei Takahashi
2016/06/15 18:14:37
Done.
|
| + |
| mojo::Binding<mojom::IntentHelperHost> binding_; |
| scoped_refptr<ActivityIconLoader> icon_loader_; |
| + scoped_refptr<base::TaskRunner> blocking_task_runner_; |
| + std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate_; |
| + |
| + base::ThreadChecker thread_checker_; |
| + |
| + // Note: This should remain the last member so it'll be destroyed and |
| + // invalidate its weak pointers before any other members are destroyed. |
| + base::WeakPtrFactory<ArcIntentHelperBridge> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); |
| }; |