| 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)
|
|
|