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 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "ash/link_handler_model_factory.h" | 11 #include "ash/link_handler_model_factory.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
15 #include "components/arc/arc_bridge_service.h" | 15 #include "components/arc/arc_bridge_service.h" |
16 #include "components/arc/arc_service.h" | 16 #include "components/arc/arc_service.h" |
17 #include "components/arc/common/intent_helper.mojom.h" | 17 #include "components/arc/common/intent_helper.mojom.h" |
| 18 #include "components/arc/instance_holder.h" |
18 #include "mojo/public/cpp/bindings/binding.h" | 19 #include "mojo/public/cpp/bindings/binding.h" |
19 | 20 |
20 namespace ash { | 21 namespace ash { |
21 | 22 |
22 class LinkHandlerModel; | 23 class LinkHandlerModel; |
23 | 24 |
24 } // namespace ash | 25 } // namespace ash |
25 | 26 |
26 namespace arc { | 27 namespace arc { |
27 | 28 |
28 class ActivityIconLoader; | 29 class ActivityIconLoader; |
29 class LocalActivityResolver; | 30 class LocalActivityResolver; |
30 class SetWallpaperDelegate; | 31 class SetWallpaperDelegate; |
31 | 32 |
32 // Receives intents from ARC. | 33 // Receives intents from ARC. |
33 class ArcIntentHelperBridge : public ArcService, | 34 class ArcIntentHelperBridge |
34 public ArcBridgeService::Observer, | 35 : public ArcService, |
35 public mojom::IntentHelperHost, | 36 public InstanceHolder<mojom::IntentHelperInstance>::Observer, |
36 public ash::LinkHandlerModelFactory { | 37 public mojom::IntentHelperHost, |
| 38 public ash::LinkHandlerModelFactory { |
37 public: | 39 public: |
38 ArcIntentHelperBridge( | 40 ArcIntentHelperBridge( |
39 ArcBridgeService* bridge_service, | 41 ArcBridgeService* bridge_service, |
40 const scoped_refptr<ActivityIconLoader>& icon_loader, | 42 const scoped_refptr<ActivityIconLoader>& icon_loader, |
41 std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate, | 43 std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate, |
42 const scoped_refptr<LocalActivityResolver>& activity_resolver); | 44 const scoped_refptr<LocalActivityResolver>& activity_resolver); |
43 ~ArcIntentHelperBridge() override; | 45 ~ArcIntentHelperBridge() override; |
44 | 46 |
45 // ArcBridgeService::Observer | 47 // InstanceHolder<mojom::IntentHelperInstance>::Observer |
46 void OnIntentHelperInstanceReady() override; | 48 void OnInstanceReady() override; |
47 void OnIntentHelperInstanceClosed() override; | 49 void OnInstanceClosed() override; |
48 | 50 |
49 // arc::mojom::IntentHelperHost | 51 // arc::mojom::IntentHelperHost |
50 void OnIconInvalidated(const mojo::String& package_name) override; | 52 void OnIconInvalidated(const mojo::String& package_name) override; |
51 void OnIntentFiltersUpdated( | 53 void OnIntentFiltersUpdated( |
52 mojo::Array<mojom::IntentFilterPtr> intent_filters) override; | 54 mojo::Array<mojom::IntentFilterPtr> intent_filters) override; |
53 void OnOpenDownloads() override; | 55 void OnOpenDownloads() override; |
54 void OnOpenUrl(const mojo::String& url) override; | 56 void OnOpenUrl(const mojo::String& url) override; |
55 void OpenWallpaperPicker() override; | 57 void OpenWallpaperPicker() override; |
56 void SetWallpaper(mojo::Array<uint8_t> jpeg_data) override; | 58 void SetWallpaper(mojo::Array<uint8_t> jpeg_data) override; |
57 | 59 |
(...skipping 15 matching lines...) Expand all Loading... |
73 scoped_refptr<LocalActivityResolver> activity_resolver_; | 75 scoped_refptr<LocalActivityResolver> activity_resolver_; |
74 | 76 |
75 base::ThreadChecker thread_checker_; | 77 base::ThreadChecker thread_checker_; |
76 | 78 |
77 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); | 79 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); |
78 }; | 80 }; |
79 | 81 |
80 } // namespace arc | 82 } // namespace arc |
81 | 83 |
82 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ | 84 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ |
OLD | NEW |