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 14 matching lines...) Expand all Loading... |
25 namespace autofill { | 25 namespace autofill { |
26 | 26 |
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 kAutofillCreditCardBankNameDisplay{ |
| 36 "AutofillCreditCardBankNameDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
35 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; | 37 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; |
36 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; | 38 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; |
37 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; | 39 const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; |
38 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; | 40 const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; |
39 const char kAutofillCreditCardPopupIsValueAndLabelInSingleLineKey[] = | 41 const char kAutofillCreditCardPopupIsValueAndLabelInSingleLineKey[] = |
40 "is_value_and_label_in_single_line"; | 42 "is_value_and_label_in_single_line"; |
41 const char kAutofillPopupDropdownItemHeightKey[] = "dropdown_item_height"; | 43 const char kAutofillPopupDropdownItemHeightKey[] = "dropdown_item_height"; |
42 const char kAutofillCreditCardPopupIsIconAtStartKey[] = | 44 const char kAutofillCreditCardPopupIsIconAtStartKey[] = |
43 "is_credit_card_icon_at_start"; | 45 "is_credit_card_icon_at_start"; |
44 const char kAutofillPopupMarginKey[] = "margin"; | 46 const char kAutofillPopupMarginKey[] = "margin"; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 82 } |
81 | 83 |
82 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { | 84 bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { |
83 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); | 85 return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); |
84 } | 86 } |
85 | 87 |
86 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { | 88 bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { |
87 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); | 89 return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); |
88 } | 90 } |
89 | 91 |
| 92 bool IsAutofillCreditCardBankNameDisplayExperimentEnabled() { |
| 93 return base::FeatureList::IsEnabled(kAutofillCreditCardBankNameDisplay); |
| 94 } |
| 95 |
90 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is | 96 // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is |
91 // not specified. 0 == |SK_ColorTRANSPARENT|. | 97 // not specified. 0 == |SK_ColorTRANSPARENT|. |
92 SkColor GetCreditCardPopupBackgroundColor() { | 98 SkColor GetCreditCardPopupBackgroundColor() { |
93 return GetCreditCardPopupParameterUintValue( | 99 return GetCreditCardPopupParameterUintValue( |
94 kAutofillCreditCardPopupBackgroundColorKey); | 100 kAutofillCreditCardPopupBackgroundColorKey); |
95 } | 101 } |
96 | 102 |
97 SkColor GetCreditCardPopupDividerColor() { | 103 SkColor GetCreditCardPopupDividerColor() { |
98 return GetCreditCardPopupParameterUintValue( | 104 return GetCreditCardPopupParameterUintValue( |
99 kAutofillCreditCardPopupDividerColorKey); | 105 kAutofillCreditCardPopupDividerColorKey); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 223 } |
218 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 224 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
219 switches::kDisableOfferUploadCreditCards)) { | 225 switches::kDisableOfferUploadCreditCards)) { |
220 return false; | 226 return false; |
221 } | 227 } |
222 | 228 |
223 return !group_name.empty() && group_name != "Disabled"; | 229 return !group_name.empty() && group_name != "Disabled"; |
224 } | 230 } |
225 | 231 |
226 } // namespace autofill | 232 } // namespace autofill |
OLD | NEW |