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

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

Issue 2146823003: Autofill Credit Card Signin Promo: Put behind Feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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 364b8c622c964b5ba049f5ba67fb37856764e333..61365695a9a5b35ecf2ad4e073497c5503a1c90f 100644
--- a/components/autofill/core/browser/autofill_experiments.cc
+++ b/components/autofill/core/browser/autofill_experiments.cc
@@ -7,18 +7,23 @@
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/prefs/pref_service.h"
#include "components/sync_driver/sync_service.h"
+#include "components/variations/variations_associated_data.h"
#include "google_apis/gaia/gaia_auth_util.h"
namespace autofill {
const base::Feature kAutofillProfileCleanup{"AutofillProfileCleanup",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kAutofillCreditCardSigninPromo{
+ "AutofillCreditCardSigninPromo", base::FEATURE_DISABLED_BY_DEFAULT};
+const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit";
bool IsAutofillEnabled(const PrefService* pref_service) {
return pref_service->GetBoolean(prefs::kAutofillEnabled);
@@ -34,6 +39,21 @@ bool IsAutofillProfileCleanupEnabled() {
return base::FeatureList::IsEnabled(kAutofillProfileCleanup);
}
+bool IsAutofillCreditCardSigninPromoEnabled() {
+ return base::FeatureList::IsEnabled(kAutofillCreditCardSigninPromo);
+}
+
+int GetCreditCardSigninPromoImpressionLimit() {
+ int impression_limit;
+ std::string param_value = variations::GetVariationParamValueByFeature(
+ kAutofillCreditCardSigninPromo,
+ kCreditCardSigninPromoImpressionLimitParamKey);
+ if (!param_value.empty() && base::StringToInt(param_value, &impression_limit))
+ return impression_limit;
+
+ return 0;
+}
+
bool OfferStoreUnmaskedCards() {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// The checkbox can be forced on with a flag, but by default we don't store
« no previous file with comments | « components/autofill/core/browser/autofill_experiments.h ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698