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}; | |
34 const base::Feature kAutofillCreditCardPopupLayout{ | 32 const base::Feature kAutofillCreditCardPopupLayout{ |
35 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; | 33 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; |
36 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ | 34 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ |
37 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; | 35 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
38 const base::Feature kAutofillOfferLocalSaveIfServerCardManuallyEntered{ | 36 const base::Feature kAutofillOfferLocalSaveIfServerCardManuallyEntered{ |
39 "AutofillOfferLocalSaveIfServerCardManuallyEntered", | 37 "AutofillOfferLocalSaveIfServerCardManuallyEntered", |
40 base::FEATURE_DISABLED_BY_DEFAULT}; | 38 base::FEATURE_DISABLED_BY_DEFAULT}; |
41 const base::Feature kAutofillUpstreamRequestCvcIfMissing{ | 39 const base::Feature kAutofillUpstreamRequestCvcIfMissing{ |
42 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; | 40 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; |
43 const base::Feature kAutofillUpstreamUseAutofillProfileComparator{ | 41 const base::Feature kAutofillUpstreamUseAutofillProfileComparator{ |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 94 } |
97 | 95 |
98 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { | 96 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { |
99 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); | 97 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); |
100 } | 98 } |
101 | 99 |
102 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { | 100 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { |
103 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); | 101 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); |
104 } | 102 } |
105 | 103 |
106 bool IsAutofillCreditCardBankNameDisplayExperimentEnabled() { | |
107 return base::FeatureList::IsEnabled(kAutofillCreditCardBankNameDisplay); | |
108 } | |
109 | |
110 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is | 104 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is |
111 // not specified. 0 == |SK_ColorTRANSPARENT|. | 105 // not specified. 0 == |SK_ColorTRANSPARENT|. |
112 SkColor GetCreditCardPopupBackgroundColor() { | 106 SkColor GetCreditCardPopupBackgroundColor() { |
113 return GetCreditCardPopupParameterUintValue( | 107 return GetCreditCardPopupParameterUintValue( |
114 kAutofillCreditCardPopupBackgroundColorKey); | 108 kAutofillCreditCardPopupBackgroundColorKey); |
115 } | 109 } |
116 | 110 |
117 SkColor GetCreditCardPopupDividerColor() { | 111 SkColor GetCreditCardPopupDividerColor() { |
118 return GetCreditCardPopupParameterUintValue( | 112 return GetCreditCardPopupParameterUintValue( |
119 kAutofillCreditCardPopupDividerColorKey); | 113 kAutofillCreditCardPopupDividerColorKey); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 int value; | 254 int value; |
261 const std::string param_value = variations::GetVariationParamValueByFeature( | 255 const std::string param_value = variations::GetVariationParamValueByFeature( |
262 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, | 256 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, |
263 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); | 257 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); |
264 if (!param_value.empty() && base::StringToInt(param_value, &value)) | 258 if (!param_value.empty() && base::StringToInt(param_value, &value)) |
265 return base::TimeDelta::FromMinutes(value); | 259 return base::TimeDelta::FromMinutes(value); |
266 return base::TimeDelta(); | 260 return base::TimeDelta(); |
267 } | 261 } |
268 | 262 |
269 } // namespace autofill | 263 } // namespace autofill |
OLD | NEW |