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

Side by Side Diff: components/autofill/core/browser/autofill_experiments.cc

Issue 2897573003: Reland - [Autofill] Enable Autofill UKM by default. (Closed)
Patch Set: Rebase Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 15 matching lines...) Expand all
26 namespace autofill { 26 namespace autofill {
27 27
28 const base::Feature kAutofillCreditCardAssist{ 28 const base::Feature kAutofillCreditCardAssist{
29 "AutofillCreditCardAssist", base::FEATURE_DISABLED_BY_DEFAULT}; 29 "AutofillCreditCardAssist", base::FEATURE_DISABLED_BY_DEFAULT};
30 const base::Feature kAutofillScanCardholderName{ 30 const base::Feature kAutofillScanCardholderName{
31 "AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT}; 31 "AutofillScanCardholderName", base::FEATURE_DISABLED_BY_DEFAULT};
32 const base::Feature kAutofillCreditCardPopupLayout{ 32 const base::Feature kAutofillCreditCardPopupLayout{
33 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT}; 33 "AutofillCreditCardPopupLayout", base::FEATURE_DISABLED_BY_DEFAULT};
34 const base::Feature kAutofillCreditCardLastUsedDateDisplay{ 34 const base::Feature kAutofillCreditCardLastUsedDateDisplay{
35 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT}; 35 "AutofillCreditCardLastUsedDateDisplay", base::FEATURE_DISABLED_BY_DEFAULT};
36 const base::Feature kAutofillUkmLogging{"AutofillUkmLogging",
37 base::FEATURE_DISABLED_BY_DEFAULT};
38 const base::Feature kAutofillUpstreamRequestCvcIfMissing{ 36 const base::Feature kAutofillUpstreamRequestCvcIfMissing{
39 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT}; 37 "AutofillUpstreamRequestCvcIfMissing", base::FEATURE_DISABLED_BY_DEFAULT};
40 const base::Feature kAutofillUpstreamUseAutofillProfileComparatorForName{ 38 const base::Feature kAutofillUpstreamUseAutofillProfileComparatorForName{
41 "AutofillUpstreamUseAutofillProfileComparatorForName", 39 "AutofillUpstreamUseAutofillProfileComparatorForName",
42 base::FEATURE_ENABLED_BY_DEFAULT}; 40 base::FEATURE_ENABLED_BY_DEFAULT};
43 const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile{ 41 const base::Feature kAutofillUpstreamUseNotRecentlyUsedAutofillProfile{
44 "AutofillUpstreamUseNotRecentlyUsedAutofillProfile", 42 "AutofillUpstreamUseNotRecentlyUsedAutofillProfile",
45 base::FEATURE_DISABLED_BY_DEFAULT}; 43 base::FEATURE_DISABLED_BY_DEFAULT};
46 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit"; 44 const char kCreditCardSigninPromoImpressionLimitParamKey[] = "impression_limit";
47 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color"; 45 const char kAutofillCreditCardPopupBackgroundColorKey[] = "background_color";
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return true; 227 return true;
230 } 228 }
231 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 229 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
232 switches::kDisableOfferUploadCreditCards)) { 230 switches::kDisableOfferUploadCreditCards)) {
233 return false; 231 return false;
234 } 232 }
235 233
236 return !group_name.empty() && group_name != "Disabled"; 234 return !group_name.empty() && group_name != "Disabled";
237 } 235 }
238 236
239 bool IsUkmLoggingEnabled() {
240 return base::FeatureList::IsEnabled(kAutofillUkmLogging);
241 }
242
243 bool IsAutofillUpstreamRequestCvcIfMissingExperimentEnabled() { 237 bool IsAutofillUpstreamRequestCvcIfMissingExperimentEnabled() {
244 #if defined(OS_ANDROID) 238 #if defined(OS_ANDROID)
245 return false; 239 return false;
246 #else 240 #else
247 return base::FeatureList::IsEnabled(kAutofillUpstreamRequestCvcIfMissing); 241 return base::FeatureList::IsEnabled(kAutofillUpstreamRequestCvcIfMissing);
248 #endif 242 #endif
249 } 243 }
250 244
251 base::TimeDelta GetMaxTimeSinceAutofillProfileUseForCardUpload() { 245 base::TimeDelta GetMaxTimeSinceAutofillProfileUseForCardUpload() {
252 int value; 246 int value;
253 const std::string param_value = variations::GetVariationParamValueByFeature( 247 const std::string param_value = variations::GetVariationParamValueByFeature(
254 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile, 248 kAutofillUpstreamUseNotRecentlyUsedAutofillProfile,
255 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey); 249 kAutofillUpstreamMaxMinutesSinceAutofillProfileUseKey);
256 if (!param_value.empty() && base::StringToInt(param_value, &value)) 250 if (!param_value.empty() && base::StringToInt(param_value, &value))
257 return base::TimeDelta::FromMinutes(value); 251 return base::TimeDelta::FromMinutes(value);
258 return base::TimeDelta(); 252 return base::TimeDelta();
259 } 253 }
260 254
261 } // namespace autofill 255 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_experiments.h ('k') | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698