Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: components/autofill/core/browser/autofill_experiments.cc

Issue 2607043002: [Autofill] Credit Card Autofill Last Used Date Experiment (Closed)
Patch Set: Add date formatter based on pattern Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 92dfff2ec07feb518449375af08dfc7179a5b4cc..576ba24bf9d7a44c5672be81b5dc38068a190436 100644
--- a/components/autofill/core/browser/autofill_experiments.cc
+++ b/components/autofill/core/browser/autofill_experiments.cc
@@ -32,16 +32,21 @@ const base::Feature kAutofillScanCardholderName{
"AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kAutofillCreditCardPopupLayout{
"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 kAutofillCreditCardLastUsedDateShowExpirationDateKey[] =
+ "show_expiration_date";
+const char kAutofillCreditCardLastUsedDateShowTimeDetailKey[] =
+ "show_time_detail";
namespace {
@@ -96,6 +101,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() {
@@ -125,6 +134,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).

Powered by Google App Engine
This is Rietveld 408576698