| 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_LOCAL_ACTIVITY_HELPER_H_ | 5 #ifndef COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ |
| 6 #define COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ | 6 #define COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "components/arc/common/intent_helper.mojom.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" |
| 9 | 12 |
| 10 class GURL; | 13 class GURL; |
| 11 | 14 |
| 12 namespace arc { | 15 namespace arc { |
| 13 | 16 |
| 14 class LocalActivityResolver { | 17 class LocalActivityResolver : public base::RefCounted<LocalActivityResolver> { |
| 15 public: | 18 public: |
| 16 LocalActivityResolver() = default; | 19 LocalActivityResolver(); |
| 17 ~LocalActivityResolver() = default; | |
| 18 | 20 |
| 19 bool ShouldChromeHandleUrl(const GURL& url); | 21 bool ShouldChromeHandleUrl(const GURL& url); |
| 22 void UpdateIntentFilters(mojo::Array<mojom::IntentFilterPtr> intent_filters); |
| 20 | 23 |
| 21 private: | 24 private: |
| 25 friend class base::RefCounted<LocalActivityResolver>; |
| 26 ~LocalActivityResolver(); |
| 27 |
| 28 bool IsRelevantIntentFilter(const mojom::IntentFilterPtr& intent_filter); |
| 29 bool FilterHasViewAction(const mojom::IntentFilterPtr& intent_filter); |
| 30 bool FilterCategoryIsBrowsable(const mojom::IntentFilterPtr& intent_filter); |
| 31 bool FilterHandlesWebSchemes(const mojom::IntentFilterPtr& intent_filter); |
| 32 |
| 33 // List of intent filters from Android. Used to determine if Chrome should |
| 34 // handle a URL without handing off to Android. |
| 35 mojo::Array<mojom::IntentFilterPtr> intent_filters_; |
| 36 |
| 22 DISALLOW_COPY_AND_ASSIGN(LocalActivityResolver); | 37 DISALLOW_COPY_AND_ASSIGN(LocalActivityResolver); |
| 23 }; | 38 }; |
| 24 | 39 |
| 25 } // namespace arc | 40 } // namespace arc |
| 26 | 41 |
| 27 #endif // COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ | 42 #endif // COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ |
| OLD | NEW |