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

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

Issue 2861223004: Adds new metric to distinguish between no address and no recent address. (Closed)
Patch Set: Updates CardUploadDecisionMetric comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 4aa8554fa316e26b4589543c47778820b3c1d27b..866d3cfc48c5ca6fd192b0a323f2d69c3d2ff945 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -1283,8 +1283,6 @@ void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
pending_upload_request_url_ = GURL(submitted_form.source_url());
- // Both the CVC and address checks are done. Conform to the legacy order of
- // reporting on CVC then address.
should_cvc_be_requested_ = false;
if (upload_request_.cvc.empty()) {
should_cvc_be_requested_ =
@@ -1322,16 +1320,21 @@ int AutofillManager::GetProfilesForCreditCardUpload(
const base::Time now = AutofillClock::Now();
const base::TimeDelta fifteen_minutes = base::TimeDelta::FromMinutes(15);
int upload_decision_metrics = 0;
+ bool has_profile = false;
// First, collect all of the addresses used recently.
for (AutofillProfile* profile : personal_data_->GetProfiles()) {
+ has_profile = true;
if ((now - profile->use_date()) < fifteen_minutes ||
(now - profile->modification_date()) < fifteen_minutes) {
candidate_profiles.push_back(*profile);
}
}
if (candidate_profiles.empty()) {
- upload_decision_metrics |= AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS;
+ upload_decision_metrics |=
+ has_profile
+ ? AutofillMetrics::UPLOAD_NOT_OFFERED_NO_RECENTLY_USED_ADDRESS
+ : AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS_PROFILE;
*rappor_metric_name = "Autofill.CardUploadNotOfferedNoAddress";
}
@@ -1407,7 +1410,7 @@ int AutofillManager::GetProfilesForCreditCardUpload(
// If none of the candidate addresses have a zip, the candidate set is
// invalid.
- if (verified_zip.empty())
+ if (verified_zip.empty() && !candidate_profiles.empty())
upload_decision_metrics |= AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ZIP_CODE;
if (!upload_decision_metrics)
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698