| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 &kImportantSitesInCBD, | 43 &kImportantSitesInCBD, |
| 44 &kNoCreditCardAbort, | 44 &kNoCreditCardAbort, |
| 45 &kNTPFakeOmniboxTextFeature, | 45 &kNTPFakeOmniboxTextFeature, |
| 46 &kNTPOfflinePagesFeature, | 46 &kNTPOfflinePagesFeature, |
| 47 &kPhysicalWebFeature, | 47 &kPhysicalWebFeature, |
| 48 &kPhysicalWebIgnoreOtherClientsFeature, | 48 &kPhysicalWebIgnoreOtherClientsFeature, |
| 49 &kScanCardsInWebPayments, | 49 &kScanCardsInWebPayments, |
| 50 &kSpecialLocaleFeature, | 50 &kSpecialLocaleFeature, |
| 51 &kSpecialLocaleWrapper, | 51 &kSpecialLocaleWrapper, |
| 52 &kTabReparenting, | 52 &kTabReparenting, |
| 53 &kWebApks, |
| 53 &ntp_snippets::kContentSuggestionsFeature, | 54 &ntp_snippets::kContentSuggestionsFeature, |
| 54 &ntp_snippets::kSaveToOfflineFeature, | 55 &ntp_snippets::kSaveToOfflineFeature, |
| 55 &ntp_snippets::kSectionDismissalFeature, | 56 &ntp_snippets::kSectionDismissalFeature, |
| 56 &offline_pages::kBackgroundLoaderForDownloadsFeature, | 57 &offline_pages::kBackgroundLoaderForDownloadsFeature, |
| 57 &offline_pages::kOfflinePagesBackgroundLoadingFeature, | 58 &offline_pages::kOfflinePagesBackgroundLoadingFeature, |
| 58 &offline_pages::kOfflinePagesCTFeature, // See crbug.com/620421. | 59 &offline_pages::kOfflinePagesCTFeature, // See crbug.com/620421. |
| 59 &offline_pages::kOfflinePagesSharingFeature, | 60 &offline_pages::kOfflinePagesSharingFeature, |
| 60 &password_manager::features::kViewPasswords, | 61 &password_manager::features::kViewPasswords, |
| 61 }; | 62 }; |
| 62 | 63 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 101 |
| 101 const base::Feature kSpecialLocaleWrapper{"SpecialLocaleWrapper", | 102 const base::Feature kSpecialLocaleWrapper{"SpecialLocaleWrapper", |
| 102 base::FEATURE_ENABLED_BY_DEFAULT}; | 103 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 103 | 104 |
| 104 const base::Feature kTabReparenting{"TabReparenting", | 105 const base::Feature kTabReparenting{"TabReparenting", |
| 105 base::FEATURE_ENABLED_BY_DEFAULT}; | 106 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 106 | 107 |
| 107 const base::Feature kUserMediaScreenCapturing{ | 108 const base::Feature kUserMediaScreenCapturing{ |
| 108 "UserMediaScreenCapturing", base::FEATURE_DISABLED_BY_DEFAULT}; | 109 "UserMediaScreenCapturing", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 109 | 110 |
| 111 // Makes "Add to Home screen" in the app menu generate an APK for the shortcut |
| 112 // URL which opens Chrome in fullscreen. |
| 113 const base::Feature kWebApks{"WebApks", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 114 |
| 110 static jboolean IsEnabled(JNIEnv* env, | 115 static jboolean IsEnabled(JNIEnv* env, |
| 111 const JavaParamRef<jclass>& clazz, | 116 const JavaParamRef<jclass>& clazz, |
| 112 const JavaParamRef<jstring>& jfeature_name) { | 117 const JavaParamRef<jstring>& jfeature_name) { |
| 113 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); | 118 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); |
| 114 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { | 119 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { |
| 115 if (kFeaturesExposedToJava[i]->name == feature_name) | 120 if (kFeaturesExposedToJava[i]->name == feature_name) |
| 116 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); | 121 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); |
| 117 } | 122 } |
| 118 // Features queried via this API must be present in |kFeaturesExposedToJava|. | 123 // Features queried via this API must be present in |kFeaturesExposedToJava|. |
| 119 NOTREACHED(); | 124 NOTREACHED(); |
| 120 return false; | 125 return false; |
| 121 } | 126 } |
| 122 | 127 |
| 123 bool RegisterChromeFeatureListJni(JNIEnv* env) { | 128 bool RegisterChromeFeatureListJni(JNIEnv* env) { |
| 124 return RegisterNativesImpl(env); | 129 return RegisterNativesImpl(env); |
| 125 } | 130 } |
| 126 | 131 |
| 127 } // namespace android | 132 } // namespace android |
| 128 } // namespace chrome | 133 } // namespace chrome |
| OLD | NEW |