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> |
| 9 |
| 10 #include "ash/renderer_context_menu/open_with_menu_controller.h" |
8 #include "base/macros.h" | 11 #include "base/macros.h" |
9 #include "components/arc/arc_bridge_service.h" | 12 #include "components/arc/arc_bridge_service.h" |
10 #include "components/arc/arc_service.h" | 13 #include "components/arc/arc_service.h" |
11 #include "components/arc/common/intent_helper.mojom.h" | 14 #include "components/arc/common/intent_helper.mojom.h" |
12 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
13 | 16 |
| 17 namespace ash { |
| 18 |
| 19 class LinkHandlerModel; |
| 20 |
| 21 } // namespace ash |
| 22 |
14 namespace arc { | 23 namespace arc { |
15 | 24 |
16 // Receives intents from ARC. | 25 // Receives intents from ARC. |
17 class ArcIntentHelperBridge : public ArcService, | 26 class ArcIntentHelperBridge : public ArcService, |
18 public ArcBridgeService::Observer, | 27 public ArcBridgeService::Observer, |
19 public IntentHelperHost { | 28 public IntentHelperHost, |
| 29 public ash::OpenWithMenuController::Delegate { |
20 public: | 30 public: |
21 explicit ArcIntentHelperBridge(ArcBridgeService* bridge_service); | 31 explicit ArcIntentHelperBridge(ArcBridgeService* bridge_service); |
22 ~ArcIntentHelperBridge() override; | 32 ~ArcIntentHelperBridge() override; |
23 | 33 |
24 // ArcBridgeService::Observer | 34 // ArcBridgeService::Observer |
25 void OnIntentHelperInstanceReady() override; | 35 void OnIntentHelperInstanceReady() override; |
| 36 void OnIntentHelperInstanceClosed() override; |
26 | 37 |
27 // arc::IntentHelperHost | 38 // arc::IntentHelperHost |
28 void OnOpenUrl(const mojo::String& url) override; | 39 void OnOpenUrl(const mojo::String& url) override; |
29 | 40 |
| 41 // ash::OpenWithMenuController::Delegate |
| 42 std::unique_ptr<ash::LinkHandlerModel> CreateModel(const GURL& url) override; |
| 43 |
30 private: | 44 private: |
31 mojo::Binding<IntentHelperHost> binding_; | 45 mojo::Binding<IntentHelperHost> binding_; |
32 | 46 |
33 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); | 47 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); |
34 }; | 48 }; |
35 | 49 |
36 } // namespace arc | 50 } // namespace arc |
37 | 51 |
38 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ | 52 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ |
OLD | NEW |