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 16 matching lines...) Expand all Loading... |
27 const base::Feature kAutofillCreditCardAssist{ | 27 const base::Feature kAutofillCreditCardAssist{ |
28 "AutofillCreditCardAssist", base::FEATURE_DISABLED_BY_DEFAULT}; | 28 "AutofillCreditCardAssist", base::FEATURE_DISABLED_BY_DEFAULT}; |
29 const base::Feature kAutofillScanCardholderName{ | 29 const base::Feature kAutofillScanCardholderName{ |
30 "AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT}; | 30 "AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT}; |
31 const base::Feature kAutofillCreditCardPopupLayout{ | 31 const base::Feature kAutofillCreditCardPopupLayout{ |
32 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; | 32 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; |
33 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ | 33 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ |
34 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; | 34 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
35 const base::Feature kAutofillUkmLogging{"AutofillUkmLogging", | 35 const base::Feature kAutofillUkmLogging{"AutofillUkmLogging", |
36 base::FEATURE_DISABLED_BY_DEFAULT}; | 36 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 37 const base::Feature kAutofillCreditCardBankNameDisplay{ |
| 38 "AutofillCreditCardBankNameDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
37 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; | 39 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; |
38 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; | 40 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; |
39 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; | 41 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; |
40 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; | 42 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; |
41 const char kAutofillCreditCardPopupIsValueAndLabelInSingleLineKey[] = | 43 const char kAutofillCreditCardPopupIsValueAndLabelInSingleLineKey[] = |
42 "is_value_and_label_in_single_line"; | 44 "is_value_and_label_in_single_line"; |
43 const char kAutofillPopupDropdownItemHeightKey[] = "dropdown_item_height"; | 45 const char kAutofillPopupDropdownItemHeightKey[] = "dropdown_item_height"; |
44 const char kAutofillCreditCardPopupIsIconAtStartKey[] = | 46 const char kAutofillCreditCardPopupIsIconAtStartKey[] = |
45 "is_credit_card_icon_at_start"; | 47 "is_credit_card_icon_at_start"; |
46 const char kAutofillPopupMarginKey[] = "margin"; | 48 const char kAutofillPopupMarginKey[] = "margin"; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 84 } |
83 | 85 |
84 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { | 86 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { |
85 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); | 87 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); |
86 } | 88 } |
87 | 89 |
88 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { | 90 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { |
89 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); | 91 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); |
90 } | 92 } |
91 | 93 |
| 94 bool IsAutofillCreditCardBankNameDisplayExperimentEnabled() { |
| 95 return base::FeatureList::IsEnabled(kAutofillCreditCardBankNameDisplay); |
| 96 } |
| 97 |
92 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is | 98 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is |
93 // not specified. 0 == |SK_ColorTRANSPARENT|. | 99 // not specified. 0 == |SK_ColorTRANSPARENT|. |
94 SkColor GetCreditCardPopupBackgroundColor() { | 100 SkColor GetCreditCardPopupBackgroundColor() { |
95 return GetCreditCardPopupParameterUintValue( | 101 return GetCreditCardPopupParameterUintValue( |
96 kAutofillCreditCardPopupBackgroundColorKey); | 102 kAutofillCreditCardPopupBackgroundColorKey); |
97 } | 103 } |
98 | 104 |
99 SkColor GetCreditCardPopupDividerColor() { | 105 SkColor GetCreditCardPopupDividerColor() { |
100 return GetCreditCardPopupParameterUintValue( | 106 return GetCreditCardPopupParameterUintValue( |
101 kAutofillCreditCardPopupDividerColorKey); | 107 kAutofillCreditCardPopupDividerColorKey); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 229 } |
224 | 230 |
225 return !group_name.empty() && group_name != "Disabled"; | 231 return !group_name.empty() && group_name != "Disabled"; |
226 } | 232 } |
227 | 233 |
228 bool IsUkmLoggingEnabled() { | 234 bool IsUkmLoggingEnabled() { |
229 return base::FeatureList::IsEnabled(kAutofillUkmLogging); | 235 return base::FeatureList::IsEnabled(kAutofillUkmLogging); |
230 } | 236 } |
231 | 237 |
232 } // namespace autofill | 238 } // namespace autofill |
OLD | NEW |