| 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 11 matching lines...) Expand all Loading... |
| 22 #include "components/variations/variations_associated_data.h" | 22 #include "components/variations/variations_associated_data.h" |
| 23 #include "google_apis/gaia/gaia_auth_util.h" | 23 #include "google_apis/gaia/gaia_auth_util.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 | 25 |
| 26 namespace autofill { | 26 namespace autofill { |
| 27 | 27 |
| 28 const base::Feature kAutofillCreditCardAssist{ | 28 const base::Feature kAutofillCreditCardAssist{ |
| 29 "AutofillCreditCardAssist", base::FEATURE_DISABLED_BY_DEFAULT}; | 29 "AutofillCreditCardAssist", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 30 const base::Feature kAutofillScanCardholderName{ | 30 const base::Feature kAutofillScanCardholderName{ |
| 31 "AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT}; | 31 "AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 32 const base::Feature kAutofillCreditCardBankNameDisplay{ |
| 33 "AutofillCreditCardBankNameDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 32 const base::Feature kAutofillCreditCardPopupLayout{ | 34 const base::Feature kAutofillCreditCardPopupLayout{ |
| 33 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; | 35 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 34 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ | 36 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ |
| 35 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; | 37 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 36 const base::Feature kAutofillUpstreamRequestCvcIfMissing{ | 38 const base::Feature kAutofillUpstreamRequestCvcIfMissing{ |
| 37 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; | 39 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 38 const base::Feature kAutofillUpstreamUseAutofillProfileComparator{ | 40 const base::Feature kAutofillUpstreamUseAutofillProfileComparator{ |
| 39 "AutofillUpstreamUseAutofillProfileComparator", | 41 "AutofillUpstreamUseAutofillProfileComparator", |
| 40 base::FEATURE_ENABLED_BY_DEFAULT}; | 42 base::FEATURE_ENABLED_BY_DEFAULT}; |
| 41 const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile{ | 43 const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile{ |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 93 } |
| 92 | 94 |
| 93 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { | 95 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { |
| 94 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); | 96 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); |
| 95 } | 97 } |
| 96 | 98 |
| 97 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { | 99 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { |
| 98 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); | 100 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); |
| 99 } | 101 } |
| 100 | 102 |
| 103 bool IsAutofillCreditCardBankNameDisplayExperimentEnabled() { |
| 104 return base::FeatureList::IsEnabled(kAutofillCreditCardBankNameDisplay); |
| 105 } |
| 106 |
| 101 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is | 107 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is |
| 102 // not specified. 0 == |SK_ColorTRANSPARENT|. | 108 // not specified. 0 == |SK_ColorTRANSPARENT|. |
| 103 SkColor GetCreditCardPopupBackgroundColor() { | 109 SkColor GetCreditCardPopupBackgroundColor() { |
| 104 return GetCreditCardPopupParameterUintValue( | 110 return GetCreditCardPopupParameterUintValue( |
| 105 kAutofillCreditCardPopupBackgroundColorKey); | 111 kAutofillCreditCardPopupBackgroundColorKey); |
| 106 } | 112 } |
| 107 | 113 |
| 108 SkColor GetCreditCardPopupDividerColor() { | 114 SkColor GetCreditCardPopupDividerColor() { |
| 109 return GetCreditCardPopupParameterUintValue( | 115 return GetCreditCardPopupParameterUintValue( |
| 110 kAutofillCreditCardPopupDividerColorKey); | 116 kAutofillCreditCardPopupDividerColorKey); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 int value; | 252 int value; |
| 247 const std::string param_value = variations::GetVariationParamValueByFeature( | 253 const std::string param_value = variations::GetVariationParamValueByFeature( |
| 248 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, | 254 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, |
| 249 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); | 255 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); |
| 250 if (!param_value.empty() && base::StringToInt(param_value, &value)) | 256 if (!param_value.empty() && base::StringToInt(param_value, &value)) |
| 251 return base::TimeDelta::FromMinutes(value); | 257 return base::TimeDelta::FromMinutes(value); |
| 252 return base::TimeDelta(); | 258 return base::TimeDelta(); |
| 253 } | 259 } |
| 254 | 260 |
| 255 } // namespace autofill | 261 } // namespace autofill |
| OLD | NEW |