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

Side by Side Diff: content/browser/android/content_feature_list.cc

Issue 2830643002: [webnfc] Add WebNFC feature flag (Closed)
Patch Set: Rebased to master Created 3 years, 8 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
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | content/child/runtime_features.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "content/browser/android/content_feature_list.h" 5 #include "content/browser/android/content_feature_list.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/public/common/content_features.h"
10 #include "jni/ContentFeatureList_jni.h" 11 #include "jni/ContentFeatureList_jni.h"
11 12
12 using base::android::ConvertJavaStringToUTF8; 13 using base::android::ConvertJavaStringToUTF8;
13 using base::android::JavaParamRef; 14 using base::android::JavaParamRef;
14 15
15 namespace content { 16 namespace content {
16 namespace android { 17 namespace android {
17 18
18 namespace { 19 namespace {
19 20
20 // Array of features exposed through the Java ContentFeatureList API. Entries in 21 // Array of features exposed through the Java ContentFeatureList API. Entries in
21 // this array may either refer to features defined in the header of this file or 22 // this array may either refer to features defined in the header of this file or
22 // in other locations in the code base (e.g. content_features.h). 23 // in other locations in the code base (e.g. content_features.h).
23 const base::Feature* kFeaturesExposedToJava[] = { 24 const base::Feature* kFeaturesExposedToJava[] = {
24 &kRequestUnbufferedDispatch, 25 &kRequestUnbufferedDispatch, &features::kWebNfc,
25 }; 26 };
26 27
27 const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) { 28 const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) {
28 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { 29 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) {
29 if (kFeaturesExposedToJava[i]->name == feature_name) 30 if (kFeaturesExposedToJava[i]->name == feature_name)
30 return kFeaturesExposedToJava[i]; 31 return kFeaturesExposedToJava[i];
31 } 32 }
32 NOTREACHED() << "Queried feature cannot be found in ContentFeatureList: " 33 NOTREACHED() << "Queried feature cannot be found in ContentFeatureList: "
33 << feature_name; 34 << feature_name;
34 return nullptr; 35 return nullptr;
(...skipping 12 matching lines...) Expand all
47 FindFeatureExposedToJava(ConvertJavaStringToUTF8(env, jfeature_name)); 48 FindFeatureExposedToJava(ConvertJavaStringToUTF8(env, jfeature_name));
48 return base::FeatureList::IsEnabled(*feature); 49 return base::FeatureList::IsEnabled(*feature);
49 } 50 }
50 51
51 bool RegisterContentFeatureListJni(JNIEnv* env) { 52 bool RegisterContentFeatureListJni(JNIEnv* env) {
52 return RegisterNativesImpl(env); 53 return RegisterNativesImpl(env);
53 } 54 }
54 55
55 } // namespace android 56 } // namespace android
56 } // namespace content 57 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | content/child/runtime_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698