| 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 "components/autofill/core/browser/autofill_experiments.h" | 5 #include "components/autofill/core/browser/autofill_experiments.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; | 35 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 36 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ | 36 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ |
| 37 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; | 37 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 38 const base::Feature kAutofillOfferLocalSaveIfServerCardManuallyEntered{ | 38 const base::Feature kAutofillOfferLocalSaveIfServerCardManuallyEntered{ |
| 39 "AutofillOfferLocalSaveIfServerCardManuallyEntered", | 39 "AutofillOfferLocalSaveIfServerCardManuallyEntered", |
| 40 base::FEATURE_DISABLED_BY_DEFAULT}; | 40 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 41 const base::Feature kAutofillSuppressDisusedAddresses{ | 41 const base::Feature kAutofillSuppressDisusedAddresses{ |
| 42 "AutofillSuppressDisusedAddresses", base::FEATURE_DISABLED_BY_DEFAULT}; | 42 "AutofillSuppressDisusedAddresses", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 43 const base::Feature kAutofillUpstreamRequestCvcIfMissing{ | 43 const base::Feature kAutofillUpstreamRequestCvcIfMissing{ |
| 44 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; | 44 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 45 const base::Feature kAutofillUpstreamShowNewUi{ |
| 46 "AutofillUpstreamShowNewUi", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 45 const base::Feature kAutofillUpstreamUseAutofillProfileComparator{ | 47 const base::Feature kAutofillUpstreamUseAutofillProfileComparator{ |
| 46 "AutofillUpstreamUseAutofillProfileComparator", | 48 "AutofillUpstreamUseAutofillProfileComparator", |
| 47 base::FEATURE_ENABLED_BY_DEFAULT}; | 49 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 48 const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile{ | 50 const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile{ |
| 49 "AutofillUpstreamUseNotRecentlyUsedAutofillProfile", | 51 "AutofillUpstreamUseNotRecentlyUsedAutofillProfile", |
| 50 base::FEATURE_DISABLED_BY_DEFAULT}; | 52 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 51 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; | 53 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; |
| 52 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; | 54 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; |
| 53 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; | 55 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; |
| 54 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; | 56 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 258 } |
| 257 | 259 |
| 258 bool IsAutofillUpstreamRequestCvcIfMissingExperimentEnabled() { | 260 bool IsAutofillUpstreamRequestCvcIfMissingExperimentEnabled() { |
| 259 #if defined(OS_ANDROID) | 261 #if defined(OS_ANDROID) |
| 260 return false; | 262 return false; |
| 261 #else | 263 #else |
| 262 return base::FeatureList::IsEnabled(kAutofillUpstreamRequestCvcIfMissing); | 264 return base::FeatureList::IsEnabled(kAutofillUpstreamRequestCvcIfMissing); |
| 263 #endif | 265 #endif |
| 264 } | 266 } |
| 265 | 267 |
| 268 bool IsAutofillUpstreamShowNewUiExperimentEnabled() { |
| 269 #if defined(OS_ANDROID) |
| 270 return false; |
| 271 #else |
| 272 return base::FeatureList::IsEnabled(kAutofillUpstreamShowNewUi); |
| 273 #endif |
| 274 } |
| 275 |
| 266 base::TimeDelta GetMaxTimeSinceAutofillProfileUseForCardUpload() { | 276 base::TimeDelta GetMaxTimeSinceAutofillProfileUseForCardUpload() { |
| 267 int value; | 277 int value; |
| 268 const std::string param_value = variations::GetVariationParamValueByFeature( | 278 const std::string param_value = variations::GetVariationParamValueByFeature( |
| 269 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, | 279 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, |
| 270 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); | 280 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); |
| 271 if (!param_value.empty() && base::StringToInt(param_value, &value)) | 281 if (!param_value.empty() && base::StringToInt(param_value, &value)) |
| 272 return base::TimeDelta::FromMinutes(value); | 282 return base::TimeDelta::FromMinutes(value); |
| 273 return base::TimeDelta(); | 283 return base::TimeDelta(); |
| 274 } | 284 } |
| 275 | 285 |
| 276 #if defined(OS_MACOSX) | 286 #if defined(OS_MACOSX) |
| 277 bool IsCreditCardAutofillTouchBarExperimentEnabled() { | 287 bool IsCreditCardAutofillTouchBarExperimentEnabled() { |
| 278 return base::FeatureList::IsEnabled(kCreditCardAutofillTouchBar); | 288 return base::FeatureList::IsEnabled(kCreditCardAutofillTouchBar); |
| 279 } | 289 } |
| 280 #endif // defined(OS_MACOSX) | 290 #endif // defined(OS_MACOSX) |
| 281 | 291 |
| 282 } // namespace autofill | 292 } // namespace autofill |
| OLD | NEW |