| 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 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/link_handler_model_factory.h" | 12 #include "ash/link_handler_model_factory.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/observer_list.h" |
| 15 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 16 #include "components/arc/arc_service.h" | 17 #include "components/arc/arc_service.h" |
| 17 #include "components/arc/common/intent_helper.mojom.h" | 18 #include "components/arc/common/intent_helper.mojom.h" |
| 18 #include "components/arc/instance_holder.h" | 19 #include "components/arc/instance_holder.h" |
| 20 #include "components/arc/intent_helper/arc_intent_helper_observer.h" |
| 19 #include "mojo/public/cpp/bindings/binding.h" | 21 #include "mojo/public/cpp/bindings/binding.h" |
| 20 | 22 |
| 21 namespace ash { | 23 namespace ash { |
| 22 | 24 |
| 23 class LinkHandlerModel; | 25 class LinkHandlerModel; |
| 24 | 26 |
| 25 } // namespace ash | 27 } // namespace ash |
| 26 | 28 |
| 27 namespace arc { | 29 namespace arc { |
| 28 | 30 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 45 // version is too old. | 47 // version is too old. |
| 46 FAILED_ARC_NOT_SUPPORTED, | 48 FAILED_ARC_NOT_SUPPORTED, |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 ArcIntentHelperBridge( | 51 ArcIntentHelperBridge( |
| 50 ArcBridgeService* bridge_service, | 52 ArcBridgeService* bridge_service, |
| 51 const scoped_refptr<ActivityIconLoader>& icon_loader, | 53 const scoped_refptr<ActivityIconLoader>& icon_loader, |
| 52 const scoped_refptr<LocalActivityResolver>& activity_resolver); | 54 const scoped_refptr<LocalActivityResolver>& activity_resolver); |
| 53 ~ArcIntentHelperBridge() override; | 55 ~ArcIntentHelperBridge() override; |
| 54 | 56 |
| 57 void AddObserver(ArcIntentHelperObserver* observer); |
| 58 void RemoveObserver(ArcIntentHelperObserver* observer); |
| 59 |
| 55 // InstanceHolder<mojom::IntentHelperInstance>::Observer | 60 // InstanceHolder<mojom::IntentHelperInstance>::Observer |
| 56 void OnInstanceReady() override; | 61 void OnInstanceReady() override; |
| 57 void OnInstanceClosed() override; | 62 void OnInstanceClosed() override; |
| 58 | 63 |
| 59 // mojom::IntentHelperHost | 64 // mojom::IntentHelperHost |
| 60 void OnIconInvalidated(const std::string& package_name) override; | 65 void OnIconInvalidated(const std::string& package_name) override; |
| 61 void OnIntentFiltersUpdated( | 66 void OnIntentFiltersUpdated( |
| 62 std::vector<mojom::IntentFilterPtr> intent_filters) override; | 67 std::vector<mojom::IntentFilterPtr> intent_filters) override; |
| 63 void OnOpenDownloads() override; | 68 void OnOpenDownloads() override; |
| 64 void OnOpenUrl(const std::string& url) override; | 69 void OnOpenUrl(const std::string& url) override; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 90 | 95 |
| 91 static const char kArcIntentHelperPackageName[]; | 96 static const char kArcIntentHelperPackageName[]; |
| 92 | 97 |
| 93 private: | 98 private: |
| 94 mojo::Binding<mojom::IntentHelperHost> binding_; | 99 mojo::Binding<mojom::IntentHelperHost> binding_; |
| 95 scoped_refptr<ActivityIconLoader> icon_loader_; | 100 scoped_refptr<ActivityIconLoader> icon_loader_; |
| 96 scoped_refptr<LocalActivityResolver> activity_resolver_; | 101 scoped_refptr<LocalActivityResolver> activity_resolver_; |
| 97 | 102 |
| 98 base::ThreadChecker thread_checker_; | 103 base::ThreadChecker thread_checker_; |
| 99 | 104 |
| 105 base::ObserverList<ArcIntentHelperObserver> observer_list_; |
| 106 |
| 100 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); | 107 DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); |
| 101 }; | 108 }; |
| 102 | 109 |
| 103 } // namespace arc | 110 } // namespace arc |
| 104 | 111 |
| 105 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ | 112 #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ |
| OLD | NEW |