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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_INTENT_HELPER_BRIDGE_H_ | 4 |
5 #define CHROME_BROWSER_CHROMEOS_ARC_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 | 7 |
7 #include "base/macros.h" | 8 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "chrome/browser/chromeos/arc/settings_bridge.h" | |
10 #include "components/arc/arc_bridge_service.h" | 9 #include "components/arc/arc_bridge_service.h" |
11 #include "components/arc/arc_service.h" | 10 #include "components/arc/arc_service.h" |
12 #include "components/arc/common/intent_helper.mojom.h" | 11 #include "components/arc/common/intent_helper.mojom.h" |
13 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
14 | 13 |
15 namespace arc { | 14 namespace arc { |
16 | 15 |
17 // Receives intents from ARC. | 16 // Receives intents from ARC. |
18 class ArcIntentHelperBridge : public ArcService, | 17 class ArcIntentHelperBridge : public ArcService, |
19 public ArcBridgeService::Observer, | 18 public ArcBridgeService::Observer, |
20 public IntentHelperHost, | 19 public IntentHelperHost { |
21 public SettingsBridge::Delegate { | |
22 public: | 20 public: |
23 explicit ArcIntentHelperBridge(ArcBridgeService* bridge_service); | 21 explicit ArcIntentHelperBridge(ArcBridgeService* bridge_service); |
24 ~ArcIntentHelperBridge() override; | 22 ~ArcIntentHelperBridge() override; |
25 | 23 |
26 // ArcBridgeService::Observer | 24 // ArcBridgeService::Observer |
27 void OnIntentHelperInstanceReady() override; | 25 void OnIntentHelperInstanceReady() override; |
28 void OnIntentHelperInstanceClosed() override; | |
29 | |
30 // SettingsBridge::Delegate. Sends a broadcast to the ArcIntentHelper app | |
31 // in Android. | |
32 void OnBroadcastNeeded(const std::string& action, | |
33 const base::DictionaryValue& extras) override; | |
34 | 26 |
35 // arc::IntentHelperHost | 27 // arc::IntentHelperHost |
36 void OnOpenUrl(const mojo::String& url) override; | 28 void OnOpenUrl(const mojo::String& url) override; |
37 | 29 |
38 private: | 30 private: |
39 mojo::Binding<IntentHelperHost> binding_; | 31 mojo::Binding<IntentHelperHost> binding_; |
40 scoped_ptr<SettingsBridge> settings_bridge_; | |
41 | 32 |
42 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); | 33 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); |
43 }; | 34 }; |
44 | 35 |
45 } // namespace arc | 36 } // namespace arc |
46 | 37 |
47 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_INTENT_HELPER_BRIDGE_H_ | 38 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ |
OLD | NEW |