| 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_IMPL_H_ | 4 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_INTENT_HELPER_BRIDGE_IMPL_H_ |
| 5 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_INTENT_HELPER_BRIDGE_IMPL_H_ | 5 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_INTENT_HELPER_BRIDGE_IMPL_H_ |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/chromeos/arc/settings_bridge.h" |
| 8 #include "components/arc/arc_bridge_service.h" | 10 #include "components/arc/arc_bridge_service.h" |
| 9 #include "components/arc/common/intent_helper.mojom.h" | 11 #include "components/arc/common/intent_helper.mojom.h" |
| 10 #include "components/arc/intent_helper/arc_intent_helper_bridge.h" | 12 #include "components/arc/intent_helper/arc_intent_helper_bridge.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 14 |
| 13 namespace arc { | 15 namespace arc { |
| 14 | 16 |
| 15 // Receives intents from ARC. | 17 // Receives intents from ARC. |
| 16 class ArcIntentHelperBridgeImpl : public ArcIntentHelperBridge, | 18 class ArcIntentHelperBridgeImpl : public ArcIntentHelperBridge, |
| 17 public ArcBridgeService::Observer, | 19 public ArcBridgeService::Observer, |
| 18 public IntentHelperHost { | 20 public IntentHelperHost, |
| 21 public SettingsBridge::Delegate { |
| 19 public: | 22 public: |
| 20 ArcIntentHelperBridgeImpl(); | 23 ArcIntentHelperBridgeImpl(); |
| 21 ~ArcIntentHelperBridgeImpl() override; | 24 ~ArcIntentHelperBridgeImpl() override; |
| 22 | 25 |
| 23 // Starts listening to state changes of the ArcBridgeService. | 26 // Starts listening to state changes of the ArcBridgeService. |
| 24 // This must be called before the bridge service starts bootstrapping. | 27 // This must be called before the bridge service starts bootstrapping. |
| 25 void StartObservingBridgeServiceChanges() override; | 28 void StartObservingBridgeServiceChanges() override; |
| 26 | 29 |
| 27 // ArcBridgeService::Observer | 30 // ArcBridgeService::Observer |
| 31 void OnStateChanged(ArcBridgeService::State state) override; |
| 28 void OnIntentHelperInstanceReady() override; | 32 void OnIntentHelperInstanceReady() override; |
| 29 | 33 |
| 34 // SettingsBridge::Delegate. Sends a broadcast to the ArcIntentHelper app |
| 35 // in Android. |
| 36 void OnBroadcastNeeded(const std::string& action, |
| 37 const base::DictionaryValue& extras) override; |
| 38 |
| 39 |
| 30 // arc::IntentHelperHost | 40 // arc::IntentHelperHost |
| 31 void OnOpenUrl(const mojo::String& url) override; | 41 void OnOpenUrl(const mojo::String& url) override; |
| 32 | 42 |
| 33 private: | 43 private: |
| 34 mojo::Binding<IntentHelperHost> binding_; | 44 mojo::Binding<IntentHelperHost> binding_; |
| 45 scoped_ptr<SettingsBridge> settings_bridge_; |
| 35 | 46 |
| 36 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridgeImpl); | 47 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridgeImpl); |
| 37 }; | 48 }; |
| 38 | 49 |
| 39 } // namespace arc | 50 } // namespace arc |
| 40 | 51 |
| 41 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_INTENT_HELPER_BRIDGE_IMPL_H_ | 52 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_INTENT_HELPER_BRIDGE_IMPL_H_ |
| OLD | NEW |