Chromium Code Reviews| Index: components/autofill/core/browser/personal_data_manager.cc |
| diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc |
| index 590f814d6073c07ed0ea15fb6515ecb2bb0dbd9d..a4d342a836a647b39508b87f8d52b273f4c11c80 100644 |
| --- a/components/autofill/core/browser/personal_data_manager.cc |
| +++ b/components/autofill/core/browser/personal_data_manager.cc |
| @@ -25,8 +25,8 @@ |
| #include "components/autofill/core/browser/autofill_country.h" |
| #include "components/autofill/core/browser/autofill_experiments.h" |
| #include "components/autofill/core/browser/autofill_field.h" |
| -#include "components/autofill/core/browser/autofill_metrics.h" |
| #include "components/autofill/core/browser/autofill_profile_comparator.h" |
| +#include "components/autofill/core/browser/autofill_ukm.h" |
| #include "components/autofill/core/browser/country_data.h" |
| #include "components/autofill/core/browser/country_names.h" |
| #include "components/autofill/core/browser/form_structure.h" |
| @@ -254,7 +254,8 @@ bool IsValidSuggestionForFieldContents(base::string16 suggestion_canon, |
| const char kFrecencyFieldTrialName[] = "AutofillProfileOrderByFrecency"; |
| const char kFrecencyFieldTrialLimitParam[] = "limit"; |
| -PersonalDataManager::PersonalDataManager(const std::string& app_locale) |
| +PersonalDataManager::PersonalDataManager(const std::string& app_locale, |
| + ukm::UkmService* ukm_service) |
| : database_(nullptr), |
| is_data_loaded_(false), |
| pending_profiles_query_(0), |
| @@ -267,7 +268,9 @@ PersonalDataManager::PersonalDataManager(const std::string& app_locale) |
| is_off_the_record_(false), |
| has_logged_profile_count_(false), |
| has_logged_local_credit_card_count_(false), |
| - has_logged_server_credit_card_counts_(false) {} |
| + has_logged_server_credit_card_counts_(false), |
| + autofill_ukm_( |
|
Mathieu
2017/03/08 22:33:49
autofill_ukm_(base::MakeUnique<AutofillUkm>(ukm_se
|
| + std::unique_ptr<AutofillUkm>(new AutofillUkm(ukm_service))) {} |
| void PersonalDataManager::Init(scoped_refptr<AutofillWebDataService> database, |
| PrefService* pref_service, |
| @@ -917,6 +920,15 @@ const std::vector<CreditCard*> PersonalDataManager::GetCreditCardsToSuggest() |
| return cards_to_suggest; |
| } |
| +void PersonalDataManager::SetCardUploadDecisionMetricUrlUkm(const GURL& url) { |
| + autofill_ukm_->SetCardUploadDecisionMetricUrl(url); |
| +} |
| + |
| +void PersonalDataManager::LogCardUploadDecisionMetricUkm( |
| + AutofillMetrics::CardUploadDecisionMetric upload_decision) { |
| + autofill_ukm_->LogCardUploadDecisionMetric(upload_decision); |
| +} |
| + |
| std::vector<Suggestion> PersonalDataManager::GetCreditCardSuggestions( |
| const AutofillType& type, |
| const base::string16& field_contents) { |