Chromium Code Reviews| 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_RESOLVER_H_ |
|
Yusuke Sato
2016/07/12 10:52:58
Good catch. Could you also run 'git cl lint' to ma
Ben Kwa
2016/07/12 16:05:23
Done.
| |
| 6 #define COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ | 6 #define COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_RESOLVER_H_ |
| 7 | |
| 8 #include <vector> | |
| 7 | 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "components/arc/common/intent_helper.mojom.h" | 12 #include "components/arc/common/intent_helper.mojom.h" |
| 13 #include "components/arc/intent_helper/intent_filter.h" | |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 15 |
| 13 class GURL; | 16 class GURL; |
| 14 | 17 |
| 15 namespace arc { | 18 namespace arc { |
| 16 | 19 |
| 17 class LocalActivityResolver : public base::RefCounted<LocalActivityResolver> { | 20 class LocalActivityResolver : public base::RefCounted<LocalActivityResolver> { |
| 18 public: | 21 public: |
| 19 LocalActivityResolver(); | 22 LocalActivityResolver(); |
| 20 | 23 |
| 21 bool ShouldChromeHandleUrl(const GURL& url); | 24 bool ShouldChromeHandleUrl(const GURL& url); |
| 22 void UpdateIntentFilters(mojo::Array<mojom::IntentFilterPtr> intent_filters); | 25 void UpdateIntentFilters(mojo::Array<mojom::IntentFilterPtr> intent_filters); |
| 23 | 26 |
| 24 private: | 27 private: |
| 25 friend class base::RefCounted<LocalActivityResolver>; | 28 friend class base::RefCounted<LocalActivityResolver>; |
| 26 ~LocalActivityResolver(); | 29 ~LocalActivityResolver(); |
| 27 | 30 |
| 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 | 31 // List of intent filters from Android. Used to determine if Chrome should |
| 34 // handle a URL without handing off to Android. | 32 // handle a URL without handing off to Android. |
| 35 mojo::Array<mojom::IntentFilterPtr> intent_filters_; | 33 std::vector<IntentFilter> intent_filters_; |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(LocalActivityResolver); | 34 DISALLOW_COPY_AND_ASSIGN(LocalActivityResolver); |
| 38 }; | 35 }; |
| 39 | 36 |
| 40 } // namespace arc | 37 } // namespace arc |
| 41 | 38 |
| 42 #endif // COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ | 39 #endif // COMPONENTS_ARC_INTENT_HELPER_LOCAL_ACTIVITY_HELPER_H_ |
| OLD | NEW |