| OLD | NEW |
| 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 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 &kNTPFakeOmniboxTextFeature, | 45 &kNTPFakeOmniboxTextFeature, |
| 46 &kNTPMaterialDesign, | 46 &kNTPMaterialDesign, |
| 47 &kNTPOfflinePagesFeature, | 47 &kNTPOfflinePagesFeature, |
| 48 &kPhysicalWebFeature, | 48 &kPhysicalWebFeature, |
| 49 &kPhysicalWebIgnoreOtherClientsFeature, | 49 &kPhysicalWebIgnoreOtherClientsFeature, |
| 50 &kReadItLaterInMenu, | 50 &kReadItLaterInMenu, |
| 51 &kScanCardsInWebPayments, | 51 &kScanCardsInWebPayments, |
| 52 &kSpecialLocaleFeature, | 52 &kSpecialLocaleFeature, |
| 53 &kSpecialLocaleWrapper, | 53 &kSpecialLocaleWrapper, |
| 54 &kTabReparenting, | 54 &kTabReparenting, |
| 55 &kCCTExternalLinkHandling, |
| 55 &offline_pages::kOfflinePagesBackgroundLoadingFeature, | 56 &offline_pages::kOfflinePagesBackgroundLoadingFeature, |
| 56 &offline_pages::kBackgroundLoaderForDownloadsFeature, | 57 &offline_pages::kBackgroundLoaderForDownloadsFeature, |
| 57 &offline_pages::kOfflinePagesCTFeature, // See crbug.com/620421. | 58 &offline_pages::kOfflinePagesCTFeature, // See crbug.com/620421. |
| 58 &offline_pages::kOfflinePagesSharingFeature, | 59 &offline_pages::kOfflinePagesSharingFeature, |
| 59 &password_manager::features::kViewPasswords, | 60 &password_manager::features::kViewPasswords, |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace | 63 } // namespace |
| 63 | 64 |
| 64 const base::Feature kAllBookmarksFeature{"AllBookmarks", | 65 const base::Feature kAllBookmarksFeature{"AllBookmarks", |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 97 |
| 97 const base::Feature kSpecialLocaleFeature{"SpecialLocale", | 98 const base::Feature kSpecialLocaleFeature{"SpecialLocale", |
| 98 base::FEATURE_DISABLED_BY_DEFAULT}; | 99 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 99 | 100 |
| 100 const base::Feature kSpecialLocaleWrapper{"SpecialLocaleWrapper", | 101 const base::Feature kSpecialLocaleWrapper{"SpecialLocaleWrapper", |
| 101 base::FEATURE_ENABLED_BY_DEFAULT}; | 102 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 102 | 103 |
| 103 const base::Feature kTabReparenting{"TabReparenting", | 104 const base::Feature kTabReparenting{"TabReparenting", |
| 104 base::FEATURE_ENABLED_BY_DEFAULT}; | 105 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 105 | 106 |
| 107 const base::Feature kCCTExternalLinkHandling{"CCTExternalLinkHandling", |
| 108 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 109 |
| 106 const base::Feature kUserMediaScreenCapturing{ | 110 const base::Feature kUserMediaScreenCapturing{ |
| 107 "UserMediaScreenCapturing", base::FEATURE_DISABLED_BY_DEFAULT}; | 111 "UserMediaScreenCapturing", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 108 | 112 |
| 109 static jboolean IsEnabled(JNIEnv* env, | 113 static jboolean IsEnabled(JNIEnv* env, |
| 110 const JavaParamRef<jclass>& clazz, | 114 const JavaParamRef<jclass>& clazz, |
| 111 const JavaParamRef<jstring>& jfeature_name) { | 115 const JavaParamRef<jstring>& jfeature_name) { |
| 112 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); | 116 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); |
| 113 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { | 117 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { |
| 114 if (kFeaturesExposedToJava[i]->name == feature_name) | 118 if (kFeaturesExposedToJava[i]->name == feature_name) |
| 115 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); | 119 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); |
| 116 } | 120 } |
| 117 // Features queried via this API must be present in |kFeaturesExposedToJava|. | 121 // Features queried via this API must be present in |kFeaturesExposedToJava|. |
| 118 NOTREACHED(); | 122 NOTREACHED(); |
| 119 return false; | 123 return false; |
| 120 } | 124 } |
| 121 | 125 |
| 122 bool RegisterChromeFeatureListJni(JNIEnv* env) { | 126 bool RegisterChromeFeatureListJni(JNIEnv* env) { |
| 123 return RegisterNativesImpl(env); | 127 return RegisterNativesImpl(env); |
| 124 } | 128 } |
| 125 | 129 |
| 126 } // namespace android | 130 } // namespace android |
| 127 } // namespace chrome | 131 } // namespace chrome |
| OLD | NEW |