| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // Array of features exposed through the Java ChromeFeatureList API. Entries in | 25 // Array of features exposed through the Java ChromeFeatureList API. Entries in |
| 26 // this array may either refer to features defined in this file (above) or in | 26 // this array may either refer to features defined in this file (above) or in |
| 27 // other locations in the code base (e.g. chrome/, components/, etc). | 27 // other locations in the code base (e.g. chrome/, components/, etc). |
| 28 const base::Feature* kFeaturesExposedToJava[] = { | 28 const base::Feature* kFeaturesExposedToJava[] = { |
| 29 &kNTPOfflinePagesFeature, | 29 &kNTPOfflinePagesFeature, |
| 30 &kNTPSnippetsFeature, | 30 &kNTPSnippetsFeature, |
| 31 &kNTPToolbarFeature, | 31 &kNTPToolbarFeature, |
| 32 &kNTPFakeOmniboxTextFeature, | 32 &kNTPFakeOmniboxTextFeature, |
| 33 &kPhysicalWebFeature, | 33 &kPhysicalWebFeature, |
| 34 &kUseNewMediaNotification, |
| 34 &features::kSimplifiedFullscreenUI, | 35 &features::kSimplifiedFullscreenUI, |
| 35 &offline_pages::kOfflinePagesBackgroundLoadingFeature, | 36 &offline_pages::kOfflinePagesBackgroundLoadingFeature, |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 } // namespace | 39 } // namespace |
| 39 | 40 |
| 40 const base::Feature kNTPOfflinePagesFeature { | 41 const base::Feature kNTPOfflinePagesFeature { |
| 41 "NTPOfflinePages", base::FEATURE_DISABLED_BY_DEFAULT | 42 "NTPOfflinePages", base::FEATURE_DISABLED_BY_DEFAULT |
| 42 }; | 43 }; |
| 43 | 44 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 const base::Feature kPhysicalWebFeature { | 57 const base::Feature kPhysicalWebFeature { |
| 57 "PhysicalWeb", base::FEATURE_DISABLED_BY_DEFAULT | 58 "PhysicalWeb", base::FEATURE_DISABLED_BY_DEFAULT |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 const base::Feature kSystemDownloadManager { | 61 const base::Feature kSystemDownloadManager { |
| 61 "SystemDownloadManager", base::FEATURE_ENABLED_BY_DEFAULT | 62 "SystemDownloadManager", base::FEATURE_ENABLED_BY_DEFAULT |
| 62 }; | 63 }; |
| 63 | 64 |
| 65 const base::Feature kUseNewMediaNotification{ |
| 66 "UseNewMediaNotification", base::FEATURE_DISABLED_BY_DEFAULT |
| 67 }; |
| 68 |
| 64 static jboolean IsEnabled(JNIEnv* env, | 69 static jboolean IsEnabled(JNIEnv* env, |
| 65 const JavaParamRef<jclass>& clazz, | 70 const JavaParamRef<jclass>& clazz, |
| 66 const JavaParamRef<jstring>& jfeature_name) { | 71 const JavaParamRef<jstring>& jfeature_name) { |
| 67 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); | 72 const std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); |
| 68 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { | 73 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { |
| 69 if (kFeaturesExposedToJava[i]->name == feature_name) | 74 if (kFeaturesExposedToJava[i]->name == feature_name) |
| 70 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); | 75 return base::FeatureList::IsEnabled(*kFeaturesExposedToJava[i]); |
| 71 } | 76 } |
| 72 // Features queried via this API must be present in |kFeaturesExposedToJava|. | 77 // Features queried via this API must be present in |kFeaturesExposedToJava|. |
| 73 NOTREACHED(); | 78 NOTREACHED(); |
| 74 return false; | 79 return false; |
| 75 } | 80 } |
| 76 | 81 |
| 77 bool RegisterChromeFeatureListJni(JNIEnv* env) { | 82 bool RegisterChromeFeatureListJni(JNIEnv* env) { |
| 78 return RegisterNativesImpl(env); | 83 return RegisterNativesImpl(env); |
| 79 } | 84 } |
| 80 | 85 |
| 81 } // namespace android | 86 } // namespace android |
| 82 } // namespace chrome | 87 } // namespace chrome |
| OLD | NEW |