Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: components/arc/intent_helper/local_activity_resolver.h

Issue 2128913002: Implement chrome-side intent filtering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply CL feedback. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698