| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ |
| 6 #define COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ | 6 #define COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/link_handler_model_factory.h" | 10 #include "ash/link_handler_model_factory.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/threading/thread_checker.h" |
| 13 #include "components/arc/arc_bridge_service.h" | 14 #include "components/arc/arc_bridge_service.h" |
| 14 #include "components/arc/arc_service.h" | 15 #include "components/arc/arc_service.h" |
| 15 #include "components/arc/common/intent_helper.mojom.h" | 16 #include "components/arc/common/intent_helper.mojom.h" |
| 16 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
| 17 | 18 |
| 18 namespace ash { | 19 namespace ash { |
| 19 | 20 |
| 20 class LinkHandlerModel; | 21 class LinkHandlerModel; |
| 21 | 22 |
| 22 } // namespace ash | 23 } // namespace ash |
| 23 | 24 |
| 24 namespace arc { | 25 namespace arc { |
| 25 | 26 |
| 26 class ActivityIconLoader; | 27 class ActivityIconLoader; |
| 28 class SetWallpaperDelegate; |
| 27 | 29 |
| 28 // Receives intents from ARC. | 30 // Receives intents from ARC. |
| 29 class ArcIntentHelperBridge : public ArcService, | 31 class ArcIntentHelperBridge : public ArcService, |
| 30 public ArcBridgeService::Observer, | 32 public ArcBridgeService::Observer, |
| 31 public mojom::IntentHelperHost, | 33 public mojom::IntentHelperHost, |
| 32 public ash::LinkHandlerModelFactory { | 34 public ash::LinkHandlerModelFactory { |
| 33 public: | 35 public: |
| 34 ArcIntentHelperBridge(ArcBridgeService* bridge_service, | 36 ArcIntentHelperBridge( |
| 35 const scoped_refptr<ActivityIconLoader>& icon_loader); | 37 ArcBridgeService* bridge_service, |
| 38 const scoped_refptr<ActivityIconLoader>& icon_loader, |
| 39 std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate); |
| 36 ~ArcIntentHelperBridge() override; | 40 ~ArcIntentHelperBridge() override; |
| 37 | 41 |
| 38 // ArcBridgeService::Observer | 42 // ArcBridgeService::Observer |
| 39 void OnIntentHelperInstanceReady() override; | 43 void OnIntentHelperInstanceReady() override; |
| 40 void OnIntentHelperInstanceClosed() override; | 44 void OnIntentHelperInstanceClosed() override; |
| 41 | 45 |
| 42 // arc::mojom::IntentHelperHost | 46 // arc::mojom::IntentHelperHost |
| 43 void OnIconInvalidated(const mojo::String& package_name) override; | 47 void OnIconInvalidated(const mojo::String& package_name) override; |
| 44 void OnOpenDownloads() override; | 48 void OnOpenDownloads() override; |
| 45 void OnOpenUrl(const mojo::String& url) override; | 49 void OnOpenUrl(const mojo::String& url) override; |
| 46 void OpenWallpaperPicker() override; | 50 void OpenWallpaperPicker() override; |
| 51 void SetWallpaper(mojo::Array<uint8_t> jpeg_data) override; |
| 47 | 52 |
| 48 // ash::LinkHandlerModelFactory | 53 // ash::LinkHandlerModelFactory |
| 49 std::unique_ptr<ash::LinkHandlerModel> CreateModel(const GURL& url) override; | 54 std::unique_ptr<ash::LinkHandlerModel> CreateModel(const GURL& url) override; |
| 50 | 55 |
| 51 private: | 56 private: |
| 52 mojo::Binding<mojom::IntentHelperHost> binding_; | 57 mojo::Binding<mojom::IntentHelperHost> binding_; |
| 53 scoped_refptr<ActivityIconLoader> icon_loader_; | 58 scoped_refptr<ActivityIconLoader> icon_loader_; |
| 59 std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate_; |
| 60 |
| 61 base::ThreadChecker thread_checker_; |
| 54 | 62 |
| 55 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); | 63 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); |
| 56 }; | 64 }; |
| 57 | 65 |
| 58 } // namespace arc | 66 } // namespace arc |
| 59 | 67 |
| 60 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ | 68 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ |
| OLD | NEW |