Chromium Code Reviews| Index: components/autofill/core/browser/autofill_experiments.cc |
| diff --git a/components/autofill/core/browser/autofill_experiments.cc b/components/autofill/core/browser/autofill_experiments.cc |
| index 777b963e8f34484524673b10c0e6783ae38dbca8..8284c2ef53e6c4652439defb59af181959e2d3aa 100644 |
| --- a/components/autofill/core/browser/autofill_experiments.cc |
| +++ b/components/autofill/core/browser/autofill_experiments.cc |
| @@ -30,16 +30,22 @@ const base::Feature kAutofillScanCardholderName{ |
| "AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT}; |
| const base::Feature kAutofillCreditCardPopupLayout{ |
|
Mathieu
2017/02/04 02:37:58
As discussed, you can reuse this feature instead o
jiahuiguo
2017/02/08 01:21:39
Keep the feature for this version, will create a m
|
| "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; |
| +const base::Feature kAutofillCreditCardLastUsedDateDisplay{ |
| + "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; |
| +const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; |
| const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; |
| const char kAutofillCreditCardPopupDividerColorKey[] = "dropdown_divider_color"; |
| const char kAutofillCreditCardPopupValueBoldKey[] = "is_value_bold"; |
| const char kAutofillCreditCardPopupIsValueAndLabelInSingleLineKey[] = |
| "is_value_and_label_in_single_line"; |
| -const char kAutofillPopupDropdownItemHeightKey[] = |
| - "dropdown_item_height"; |
| +const char kAutofillPopupDropdownItemHeightKey[] = "dropdown_item_height"; |
| const char kAutofillCreditCardPopupIsIconAtStartKey[] = |
| "is_credit_card_icon_at_start"; |
| const char kAutofillPopupMarginKey[] = "margin"; |
| +const char kAutofillCreditCardLastUsedDateShowExpirationDateKey[] = |
| + "show_expiration_date"; |
| +const char kAutofillCreditCardLastUsedDateShowTimeDetailKey[] = |
| + "show_time_detail"; |
| namespace { |
| @@ -79,6 +85,10 @@ bool IsAutofillCreditCardPopupLayoutExperimentEnabled() { |
| return base::FeatureList::IsEnabled(kAutofillCreditCardPopupLayout); |
| } |
| +bool IsAutofillCreditCardLastUsedDateDisplayExperimentEnabled() { |
| + return base::FeatureList::IsEnabled(kAutofillCreditCardLastUsedDateDisplay); |
| +} |
| + |
| // |GetCreditCardPopupParameterUintValue| returns 0 if experiment parameter is |
| // not specified. 0 == |SK_ColorTRANSPARENT|. |
| SkColor GetCreditCardPopupBackgroundColor() { |
| @@ -108,6 +118,20 @@ bool IsIconInCreditCardPopupAtStart() { |
| return param_value == "true"; |
| } |
| +bool ShowExpirationDateInAutofillCreditCardLastUsedDate() { |
| + const std::string param_value = variations::GetVariationParamValueByFeature( |
| + kAutofillCreditCardLastUsedDateDisplay, |
| + kAutofillCreditCardLastUsedDateShowExpirationDateKey); |
| + return param_value == "true"; |
| +} |
| + |
| +bool ShowTimeDetailInAutofillCreditCardLastUsedDate() { |
| + const std::string param_value = variations::GetVariationParamValueByFeature( |
| + kAutofillCreditCardLastUsedDateDisplay, |
| + kAutofillCreditCardLastUsedDateShowTimeDetailKey); |
| + return param_value == "true"; |
| +} |
| + |
| // Modifies |suggestion| as follows if experiment to display value and label in |
| // a single line is enabled. |
| // Say, |value| is 'Visa ....1111' and |label| is '01/18' (expiration date). |