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

Side by Side Diff: chrome/browser/android/chrome_feature_list.cc

Issue 1512113002: Read feature param for Physical Web experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 12 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/android/chrome_feature_list.h ('k') | chrome/common/chrome_switches.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/android/chrome_feature_list.h" 5 #include "chrome/browser/android/chrome_feature_list.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/android/jni_string.h" 11 #include "base/android/jni_string.h"
12 #include "base/feature_list.h" 12 #include "base/feature_list.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "jni/ChromeFeatureList_jni.h" 14 #include "jni/ChromeFeatureList_jni.h"
15 15
16 using base::android::ConvertJavaStringToUTF8; 16 using base::android::ConvertJavaStringToUTF8;
17 17
18 namespace chrome { 18 namespace chrome {
19 namespace android { 19 namespace android {
20 20
21 namespace { 21 namespace {
22 22
23 const base::Feature kPhysicalWebFeature {
24 "PhysicalWeb", base::FEATURE_DISABLED_BY_DEFAULT
25 };
26
27 // Array of features exposed through the Java ChromeFeatureList API. Entries in 23 // Array of features exposed through the Java ChromeFeatureList API. Entries in
28 // this array may either refer to features defined in this file (above) or in 24 // this array may either refer to features defined in this file (above) or in
29 // other locations in the code base (e.g. chrome/, components/, etc). 25 // other locations in the code base (e.g. chrome/, components/, etc).
30 const base::Feature* kFeaturesExposedToJava[] = { 26 const base::Feature* kFeaturesExposedToJava[] = {
31 &kPhysicalWebFeature, 27 &kPhysicalWebFeature,
32 }; 28 };
33 29
34 } // namespace 30 } // namespace
35 31
32 const base::Feature kPhysicalWebFeature {
33 "PhysicalWeb", base::FEATURE_DISABLED_BY_DEFAULT
34 };
35
36 static jboolean IsEnabled(JNIEnv* env, 36 static jboolean IsEnabled(JNIEnv* env,
37 const JavaParamRef<jclass>& clazz, 37 const JavaParamRef<jclass>& clazz,
38 const JavaParamRef<jstring>& jfeature_name) { 38 const JavaParamRef<jstring>& jfeature_name) {
39 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); 39 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name);
40 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { 40 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) {
41 if (kFeaturesExposedToJava[i]->name == feature_name) 41 if (kFeaturesExposedToJava[i]->name == feature_name)
42 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); 42 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]);
43 } 43 }
44 // Features queried via this API must be present in |kFeaturesExposedToJava|. 44 // Features queried via this API must be present in |kFeaturesExposedToJava|.
45 NOTREACHED(); 45 NOTREACHED();
46 return false; 46 return false;
47 } 47 }
48 48
49 bool RegisterChromeFeatureListJni(JNIEnv* env) { 49 bool RegisterChromeFeatureListJni(JNIEnv* env) {
50 return RegisterNativesImpl(env); 50 return RegisterNativesImpl(env);
51 } 51 }
52 52
53 } // namespace android 53 } // namespace android
54 } // namespace chrome 54 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/android/chrome_feature_list.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698