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{ |
42 "AutofillUpstreamUseNotRecentlyUsedAutofillProfile", | 44 "AutofillUpstreamUseNotRecentlyUsedAutofillProfile", |
43 base::FEATURE_DISABLED_BY_DEFAULT}; | 45 base::FEATURE_DISABLED_BY_DEFAULT}; |
44 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; | 46 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; |
| 47 const char kAutofillCreditCardBankNameDisplayInTitle[] = |
| 48 "show_bank_name_in_title"; |
45 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; | 49 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; |
46 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; | 50 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; |
47 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; | 51 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; |
48 const char kAutofillCreditCardPopupIsValueAndLabelInSingleLineKey[] = | 52 const char kAutofillCreditCardPopupIsValueAndLabelInSingleLineKey[] = |
49 "is_value_and_label_in_single_line"; | 53 "is_value_and_label_in_single_line"; |
50 const char kAutofillPopupDropdownItemHeightKey[] = "dropdown_item_height"; | 54 const char kAutofillPopupDropdownItemHeightKey[] = "dropdown_item_height"; |
51 const char kAutofillCreditCardPopupIsIconAtStartKey[] = | 55 const char kAutofillCreditCardPopupIsIconAtStartKey[] = |
52 "is_credit_card_icon_at_start"; | 56 "is_credit_card_icon_at_start"; |
53 const char kAutofillPopupMarginKey[] = "margin"; | 57 const char kAutofillPopupMarginKey[] = "margin"; |
54 const char kAutofillCreditCardLastUsedDateShowExpirationDateKey[] = | 58 const char kAutofillCreditCardLastUsedDateShowExpirationDateKey[] = |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 95 } |
92 | 96 |
93 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { | 97 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { |
94 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); | 98 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); |
95 } | 99 } |
96 | 100 |
97 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { | 101 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { |
98 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); | 102 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); |
99 } | 103 } |
100 | 104 |
| 105 bool IsAutofillCreditCardBankNameDisplayExperimentEnabled() { |
| 106 return base::FeatureList::IsEnabled(kAutofillCreditCardBankNameDisplay); |
| 107 } |
| 108 |
101 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is | 109 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is |
102 // not specified. 0 == |SK_ColorTRANSPARENT|. | 110 // not specified. 0 == |SK_ColorTRANSPARENT|. |
103 SkColor GetCreditCardPopupBackgroundColor() { | 111 SkColor GetCreditCardPopupBackgroundColor() { |
104 return GetCreditCardPopupParameterUintValue( | 112 return GetCreditCardPopupParameterUintValue( |
105 kAutofillCreditCardPopupBackgroundColorKey); | 113 kAutofillCreditCardPopupBackgroundColorKey); |
106 } | 114 } |
107 | 115 |
108 SkColor GetCreditCardPopupDividerColor() { | 116 SkColor GetCreditCardPopupDividerColor() { |
109 return GetCreditCardPopupParameterUintValue( | 117 return GetCreditCardPopupParameterUintValue( |
110 kAutofillCreditCardPopupDividerColorKey); | 118 kAutofillCreditCardPopupDividerColorKey); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 int value; | 254 int value; |
247 const std::string param_value = variations::GetVariationParamValueByFeature( | 255 const std::string param_value = variations::GetVariationParamValueByFeature( |
248 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, | 256 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, |
249 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); | 257 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); |
250 if (!param_value.empty() && base::StringToInt(param_value, &value)) | 258 if (!param_value.empty() && base::StringToInt(param_value, &value)) |
251 return base::TimeDelta::FromMinutes(value); | 259 return base::TimeDelta::FromMinutes(value); |
252 return base::TimeDelta(); | 260 return base::TimeDelta(); |
253 } | 261 } |
254 | 262 |
255 } // namespace autofill | 263 } // namespace autofill |
OLD | NEW |