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

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

Issue 2082483005: [Autofill] Log RAPPOR metrics around credit card upload failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: null check Created 4 years, 6 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_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 56b42b3e37bd4ee7fd28d620cf2c84d4db44ac4b..33d8c1ea80501fc053aff35636ec7c856a3dc6f8 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -58,6 +58,7 @@
#include "components/autofill/core/common/password_form_fill_data.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
+#include "components/rappor/rappor_utils.h"
#include "google_apis/gaia/identity_provider.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -1076,13 +1077,20 @@ void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
if (upload_request_.cvc.empty()) {
AutofillMetrics::LogCardUploadDecisionMetric(
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_CVC);
+ if (submitted_form.source_url().is_valid() &&
Justin Donnelly 2016/06/21 15:04:54 This is a complicated bit of code that's difficult
Mathieu 2016/06/21 17:05:08 Sure, I prefer the first version.
+ client_->GetRapporService()) {
+ rappor::SampleDomainAndRegistryFromGURL(
+ client_->GetRapporService(), "Autofill.CardUploadNotOfferedNoCvc",
+ submitted_form.source_url());
+ }
return;
}
// Upload also requires recently used or modified addresses that meet the
// client-side validation rules.
if (!GetProfilesForCreditCardUpload(*imported_credit_card,
- &upload_request_.profiles)) {
+ &upload_request_.profiles,
+ submitted_form.source_url())) {
return;
}
@@ -1093,7 +1101,8 @@ void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
bool AutofillManager::GetProfilesForCreditCardUpload(
const CreditCard& card,
- std::vector<AutofillProfile>* profiles) const {
+ std::vector<AutofillProfile>* profiles,
+ const GURL& source_url) const {
std::vector<AutofillProfile> candidate_profiles;
const base::Time now = base::Time::Now();
const base::TimeDelta fifteen_minutes = base::TimeDelta::FromMinutes(15);
@@ -1108,6 +1117,11 @@ bool AutofillManager::GetProfilesForCreditCardUpload(
if (candidate_profiles.empty()) {
AutofillMetrics::LogCardUploadDecisionMetric(
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_ADDRESS);
+ if (source_url.is_valid() && client_->GetRapporService()) {
+ rappor::SampleDomainAndRegistryFromGURL(
+ client_->GetRapporService(), "Autofill.CardUploadNotOfferedNoAddress",
+ source_url);
+ }
return false;
}
@@ -1137,6 +1151,11 @@ bool AutofillManager::GetProfilesForCreditCardUpload(
verified_name, RemoveMiddleInitial(address_name))) {
AutofillMetrics::LogCardUploadDecisionMetric(
AutofillMetrics::UPLOAD_NOT_OFFERED_CONFLICTING_NAMES);
+ if (source_url.is_valid() && client_->GetRapporService()) {
+ rappor::SampleDomainAndRegistryFromGURL(
+ client_->GetRapporService(),
+ "Autofill.CardUploadNotOfferedConflictingNames", source_url);
+ }
return false;
}
}
@@ -1147,6 +1166,11 @@ bool AutofillManager::GetProfilesForCreditCardUpload(
if (verified_name.empty()) {
AutofillMetrics::LogCardUploadDecisionMetric(
AutofillMetrics::UPLOAD_NOT_OFFERED_NO_NAME);
+ if (source_url.is_valid() && client_->GetRapporService()) {
+ rappor::SampleDomainAndRegistryFromGURL(
+ client_->GetRapporService(), "Autofill.CardUploadNotOfferedNoName",
+ source_url);
+ }
return false;
}
« no previous file with comments | « components/autofill/core/browser/autofill_manager.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