| 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 19 matching lines...) Expand all Loading... |
| 30 // Array of features exposed through the Java ChromeFeatureList API. Entries in | 30 // Array of features exposed through the Java ChromeFeatureList API. Entries in |
| 31 // this array may either refer to features defined in the header of this file or | 31 // this array may either refer to features defined in the header of this file or |
| 32 // in other locations in the code base (e.g. chrome/, components/, etc). | 32 // in other locations in the code base (e.g. chrome/, components/, etc). |
| 33 const base::Feature* kFeaturesExposedToJava[] = { | 33 const base::Feature* kFeaturesExposedToJava[] = { |
| 34 &autofill::kAutofillScanCardholderName, | 34 &autofill::kAutofillScanCardholderName, |
| 35 &features::kAutoplayMutedVideos, | 35 &features::kAutoplayMutedVideos, |
| 36 &features::kCredentialManagementAPI, | 36 &features::kCredentialManagementAPI, |
| 37 &features::kSimplifiedFullscreenUI, | 37 &features::kSimplifiedFullscreenUI, |
| 38 &features::kWebPayments, | 38 &features::kWebPayments, |
| 39 &kAndroidPayIntegrationV1, | 39 &kAndroidPayIntegrationV1, |
| 40 &kCCTExternalLinkHandling, |
| 40 &kChromeHomeFeature, | 41 &kChromeHomeFeature, |
| 42 &kContextualSearchSingleActions, |
| 41 &kDownloadsUiFeature, | 43 &kDownloadsUiFeature, |
| 42 &kImportantSitesInCBD, | 44 &kImportantSitesInCBD, |
| 43 &ntp_snippets::kContentSuggestionsFeature, | 45 &ntp_snippets::kContentSuggestionsFeature, |
| 44 &ntp_snippets::kSaveToOfflineFeature, | 46 &ntp_snippets::kSaveToOfflineFeature, |
| 45 &ntp_snippets::kSectionDismissalFeature, | 47 &ntp_snippets::kSectionDismissalFeature, |
| 46 &kNTPFakeOmniboxTextFeature, | 48 &kNTPFakeOmniboxTextFeature, |
| 47 &kNTPOfflinePagesFeature, | 49 &kNTPOfflinePagesFeature, |
| 48 &kPhysicalWebFeature, | 50 &kPhysicalWebFeature, |
| 49 &kPhysicalWebIgnoreOtherClientsFeature, | 51 &kPhysicalWebIgnoreOtherClientsFeature, |
| 50 &kScanCardsInWebPayments, | 52 &kScanCardsInWebPayments, |
| 51 &kSpecialLocaleFeature, | 53 &kSpecialLocaleFeature, |
| 52 &kSpecialLocaleWrapper, | 54 &kSpecialLocaleWrapper, |
| 53 &kTabReparenting, | 55 &kTabReparenting, |
| 54 &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 |
| 65 // Alphabetical: |
| 64 const base::Feature kAndroidPayIntegrationV1{"AndroidPayIntegrationV1", | 66 const base::Feature kAndroidPayIntegrationV1{"AndroidPayIntegrationV1", |
| 65 base::FEATURE_ENABLED_BY_DEFAULT}; | 67 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 66 | 68 |
| 69 const base::Feature kCCTExternalLinkHandling{"CCTExternalLinkHandling", |
| 70 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 71 |
| 67 const base::Feature kChromeHomeFeature{"ChromeHome", | 72 const base::Feature kChromeHomeFeature{"ChromeHome", |
| 68 base::FEATURE_DISABLED_BY_DEFAULT}; | 73 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 69 | 74 |
| 75 const base::Feature kContextualSearchSingleActions{ |
| 76 "ContextualSearchSingleActions", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 77 |
| 70 const base::Feature kDownloadsUiFeature{"DownloadsUi", | 78 const base::Feature kDownloadsUiFeature{"DownloadsUi", |
| 71 base::FEATURE_DISABLED_BY_DEFAULT}; | 79 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 72 | 80 |
| 73 const base::Feature kImportantSitesInCBD{"ImportantSitesInCBD", | 81 const base::Feature kImportantSitesInCBD{"ImportantSitesInCBD", |
| 74 base::FEATURE_DISABLED_BY_DEFAULT}; | 82 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 75 | 83 |
| 76 const base::Feature kNTPOfflinePagesFeature{"NTPOfflinePages", | 84 const base::Feature kNTPOfflinePagesFeature{"NTPOfflinePages", |
| 77 base::FEATURE_DISABLED_BY_DEFAULT}; | 85 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 78 | 86 |
| 79 const base::Feature kNTPFakeOmniboxTextFeature{ | 87 const base::Feature kNTPFakeOmniboxTextFeature{ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 90 | 98 |
| 91 const base::Feature kSpecialLocaleFeature{"SpecialLocale", | 99 const base::Feature kSpecialLocaleFeature{"SpecialLocale", |
| 92 base::FEATURE_DISABLED_BY_DEFAULT}; | 100 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 93 | 101 |
| 94 const base::Feature kSpecialLocaleWrapper{"SpecialLocaleWrapper", | 102 const base::Feature kSpecialLocaleWrapper{"SpecialLocaleWrapper", |
| 95 base::FEATURE_ENABLED_BY_DEFAULT}; | 103 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 96 | 104 |
| 97 const base::Feature kTabReparenting{"TabReparenting", | 105 const base::Feature kTabReparenting{"TabReparenting", |
| 98 base::FEATURE_ENABLED_BY_DEFAULT}; | 106 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 99 | 107 |
| 100 const base::Feature kCCTExternalLinkHandling{"CCTExternalLinkHandling", | |
| 101 base::FEATURE_ENABLED_BY_DEFAULT}; | |
| 102 | |
| 103 const base::Feature kUserMediaScreenCapturing{ | 108 const base::Feature kUserMediaScreenCapturing{ |
| 104 "UserMediaScreenCapturing", base::FEATURE_DISABLED_BY_DEFAULT}; | 109 "UserMediaScreenCapturing", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 105 | 110 |
| 106 static jboolean IsEnabled(JNIEnv* env, | 111 static jboolean IsEnabled(JNIEnv* env, |
| 107 const JavaParamRef<jclass>& clazz, | 112 const JavaParamRef<jclass>& clazz, |
| 108 const JavaParamRef<jstring>& jfeature_name) { | 113 const JavaParamRef<jstring>& jfeature_name) { |
| 109 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); | 114 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); |
| 110 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { | 115 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { |
| 111 if (kFeaturesExposedToJava[i]->name == feature_name) | 116 if (kFeaturesExposedToJava[i]->name == feature_name) |
| 112 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); | 117 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); |
| 113 } | 118 } |
| 114 // Features queried via this API must be present in |kFeaturesExposedToJava|. | 119 // Features queried via this API must be present in |kFeaturesExposedToJava|. |
| 115 NOTREACHED(); | 120 NOTREACHED(); |
| 116 return false; | 121 return false; |
| 117 } | 122 } |
| 118 | 123 |
| 119 bool RegisterChromeFeatureListJni(JNIEnv* env) { | 124 bool RegisterChromeFeatureListJni(JNIEnv* env) { |
| 120 return RegisterNativesImpl(env); | 125 return RegisterNativesImpl(env); |
| 121 } | 126 } |
| 122 | 127 |
| 123 } // namespace android | 128 } // namespace android |
| 124 } // namespace chrome | 129 } // namespace chrome |
| OLD | NEW |