| 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 |
| 11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 12 #include "base/feature_list.h" | 12 #include "base/feature_list.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/metrics/field_trial_params.h" | 14 #include "base/metrics/field_trial_params.h" |
| 15 #include "chrome/common/chrome_features.h" | 15 #include "chrome/common/chrome_features.h" |
| 16 #include "components/autofill/core/browser/autofill_experiments.h" | 16 #include "components/autofill/core/browser/autofill_experiments.h" |
| 17 #include "components/ntp_snippets/features.h" | 17 #include "components/ntp_snippets/features.h" |
| 18 #include "components/offline_pages/core/offline_page_feature.h" | 18 #include "components/offline_pages/core/offline_page_feature.h" |
| 19 #include "components/password_manager/core/common/password_manager_features.h" | 19 #include "components/password_manager/core/common/password_manager_features.h" |
| 20 #include "components/subresource_filter/core/browser/subresource_filter_features
.h" |
| 20 #include "content/public/common/content_features.h" | 21 #include "content/public/common/content_features.h" |
| 21 #include "jni/ChromeFeatureList_jni.h" | 22 #include "jni/ChromeFeatureList_jni.h" |
| 22 | 23 |
| 23 using base::android::ConvertJavaStringToUTF8; | 24 using base::android::ConvertJavaStringToUTF8; |
| 24 using base::android::ConvertUTF8ToJavaString; | 25 using base::android::ConvertUTF8ToJavaString; |
| 25 using base::android::JavaParamRef; | 26 using base::android::JavaParamRef; |
| 26 using base::android::ScopedJavaLocalRef; | 27 using base::android::ScopedJavaLocalRef; |
| 27 | 28 |
| 28 namespace chrome { | 29 namespace chrome { |
| 29 namespace android { | 30 namespace android { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 &kWebVRCardboardSupport, | 75 &kWebVRCardboardSupport, |
| 75 &ntp_snippets::kIncreasedVisibility, | 76 &ntp_snippets::kIncreasedVisibility, |
| 76 &ntp_snippets::kForeignSessionsSuggestionsFeature, | 77 &ntp_snippets::kForeignSessionsSuggestionsFeature, |
| 77 &ntp_snippets::kOfflineBadgeFeature, | 78 &ntp_snippets::kOfflineBadgeFeature, |
| 78 &ntp_snippets::kPublisherFaviconsFromNewServerFeature, | 79 &ntp_snippets::kPublisherFaviconsFromNewServerFeature, |
| 79 &ntp_snippets::kSaveToOfflineFeature, | 80 &ntp_snippets::kSaveToOfflineFeature, |
| 80 &offline_pages::kBackgroundLoaderForDownloadsFeature, | 81 &offline_pages::kBackgroundLoaderForDownloadsFeature, |
| 81 &offline_pages::kOfflinePagesCTFeature, // See crbug.com/620421. | 82 &offline_pages::kOfflinePagesCTFeature, // See crbug.com/620421. |
| 82 &offline_pages::kOfflinePagesSharingFeature, | 83 &offline_pages::kOfflinePagesSharingFeature, |
| 83 &password_manager::features::kViewPasswords, | 84 &password_manager::features::kViewPasswords, |
| 85 &subresource_filter::kSafeBrowsingSubresourceFilterExperimentalUI, |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) { | 88 const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) { |
| 87 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { | 89 for (size_t i = 0; i < arraysize(kFeaturesExposedToJava); ++i) { |
| 88 if (kFeaturesExposedToJava[i]->name == feature_name) | 90 if (kFeaturesExposedToJava[i]->name == feature_name) |
| 89 return kFeaturesExposedToJava[i]; | 91 return kFeaturesExposedToJava[i]; |
| 90 } | 92 } |
| 91 NOTREACHED() << "Queried feature cannot be found in ChromeFeatureList: " | 93 NOTREACHED() << "Queried feature cannot be found in ChromeFeatureList: " |
| 92 << feature_name; | 94 << feature_name; |
| 93 return nullptr; | 95 return nullptr; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 return base::GetFieldTrialParamByFeatureAsBool(*feature, param_name, | 257 return base::GetFieldTrialParamByFeatureAsBool(*feature, param_name, |
| 256 jdefault_value); | 258 jdefault_value); |
| 257 } | 259 } |
| 258 | 260 |
| 259 bool RegisterChromeFeatureListJni(JNIEnv* env) { | 261 bool RegisterChromeFeatureListJni(JNIEnv* env) { |
| 260 return RegisterNativesImpl(env); | 262 return RegisterNativesImpl(env); |
| 261 } | 263 } |
| 262 | 264 |
| 263 } // namespace android | 265 } // namespace android |
| 264 } // namespace chrome | 266 } // namespace chrome |
| OLD | NEW |