| 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 &features::kCredentialManagementAPI, | 30 &features::kCredentialManagementAPI, |
| 31 &features::kSimplifiedFullscreenUI, | 31 &features::kSimplifiedFullscreenUI, |
| 32 &kImportantSitesInCBD, | 32 &kImportantSitesInCBD, |
| 33 &kMediaStyleNotification, | 33 &kMediaStyleNotification, |
| 34 &kNTPFakeOmniboxTextFeature, | 34 &kNTPFakeOmniboxTextFeature, |
| 35 &kNTPMaterialDesign, | 35 &kNTPMaterialDesign, |
| 36 &kNTPOfflinePagesFeature, | 36 &kNTPOfflinePagesFeature, |
| 37 &kNTPSnippetsFeature, | 37 &kNTPSnippetsFeature, |
| 38 &kNTPToolbarFeature, | 38 &kNTPToolbarFeature, |
| 39 &kPhysicalWebFeature, | 39 &kPhysicalWebFeature, |
| 40 &kReadItLaterInMenu, |
| 40 &kSystemDownloadManager, | 41 &kSystemDownloadManager, |
| 41 &offline_pages::kOfflinePagesBackgroundLoadingFeature, | 42 &offline_pages::kOfflinePagesBackgroundLoadingFeature, |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace | 45 } // namespace |
| 45 | 46 |
| 46 const base::Feature kImportantSitesInCBD{"ImportantSitesInCBD", | 47 const base::Feature kImportantSitesInCBD{"ImportantSitesInCBD", |
| 47 base::FEATURE_DISABLED_BY_DEFAULT}; | 48 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 48 | 49 |
| 49 const base::Feature kMediaStyleNotification { | 50 const base::Feature kMediaStyleNotification { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 const base::Feature kNTPFakeOmniboxTextFeature { | 69 const base::Feature kNTPFakeOmniboxTextFeature { |
| 69 "NTPFakeOmniboxText", base::FEATURE_DISABLED_BY_DEFAULT | 70 "NTPFakeOmniboxText", base::FEATURE_DISABLED_BY_DEFAULT |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 const base::Feature kPhysicalWebFeature { | 73 const base::Feature kPhysicalWebFeature { |
| 73 "PhysicalWeb", base::FEATURE_ENABLED_BY_DEFAULT | 74 "PhysicalWeb", base::FEATURE_ENABLED_BY_DEFAULT |
| 74 }; | 75 }; |
| 75 | 76 |
| 77 const base::Feature kReadItLaterInMenu { |
| 78 "ReadItLaterInMenu", base::FEATURE_DISABLED_BY_DEFAULT |
| 79 }; |
| 80 |
| 76 const base::Feature kSystemDownloadManager { | 81 const base::Feature kSystemDownloadManager { |
| 77 "SystemDownloadManager", base::FEATURE_ENABLED_BY_DEFAULT | 82 "SystemDownloadManager", base::FEATURE_ENABLED_BY_DEFAULT |
| 78 }; | 83 }; |
| 79 | 84 |
| 80 static jboolean IsEnabled(JNIEnv* env, | 85 static jboolean IsEnabled(JNIEnv* env, |
| 81 const JavaParamRef<jclass>& clazz, | 86 const JavaParamRef<jclass>& clazz, |
| 82 const JavaParamRef<jstring>& jfeature_name) { | 87 const JavaParamRef<jstring>& jfeature_name) { |
| 83 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); | 88 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); |
| 84 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { | 89 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { |
| 85 if (kFeaturesExposedToJava[i]->name == feature_name) | 90 if (kFeaturesExposedToJava[i]->name == feature_name) |
| 86 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); | 91 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); |
| 87 } | 92 } |
| 88 // Features queried via this API must be present in |kFeaturesExposedToJava|. | 93 // Features queried via this API must be present in |kFeaturesExposedToJava|. |
| 89 NOTREACHED(); | 94 NOTREACHED(); |
| 90 return false; | 95 return false; |
| 91 } | 96 } |
| 92 | 97 |
| 93 bool RegisterChromeFeatureListJni(JNIEnv* env) { | 98 bool RegisterChromeFeatureListJni(JNIEnv* env) { |
| 94 return RegisterNativesImpl(env); | 99 return RegisterNativesImpl(env); |
| 95 } | 100 } |
| 96 | 101 |
| 97 } // namespace android | 102 } // namespace android |
| 98 } // namespace chrome | 103 } // namespace chrome |
| OLD | NEW |