Chromium Code Reviews| 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 5df3ca14bda7fa0fee2dde5a92456f091613c803..dd369f80ff158c7812cdb01b1d154c99f1e0c3d4 100644 |
| --- a/components/autofill/core/browser/autofill_manager.cc |
| +++ b/components/autofill/core/browser/autofill_manager.cc |
| @@ -17,6 +17,7 @@ |
| #include "base/logging.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/metrics/field_trial.h" |
| +#include "base/metrics/histogram.h" |
|
Ilya Sherman
2015/05/15 21:14:58
nit: Please include histogram_macros.h instead.
erikchen
2015/05/15 21:37:23
Done.
|
| #include "base/prefs/pref_service.h" |
| #include "base/strings/string16.h" |
| #include "base/strings/string_util.h" |
| @@ -700,6 +701,21 @@ void AutofillManager::OnHidePopup() { |
| client_->HideAutofillPopup(); |
| } |
| +void AutofillManager::OnUserDidAcceptAutofillSuggestion(int unique_id) { |
| +#if defined(OS_MACOSX) && !defined(OS_IOS) |
| + size_t variant = 0; |
| + const AutofillProfile* profile = nullptr; |
| + bool result = GetProfile(unique_id, &profile, &variant); |
| + if (!result) |
| + return; |
| + |
| + bool is_from_address_book = |
| + profile->record_type() == AutofillProfile::AUXILIARY_PROFILE; |
| + UMA_HISTOGRAM_BOOLEAN("Autofill.MacAddressBook.AcceptedResultFromAddressBook", |
|
Ilya Sherman
2015/05/15 21:14:58
nit: I'd name this "AcceptedResultIsFromAddressBoo
erikchen
2015/05/15 21:37:23
Done.
|
| + is_from_address_book); |
| +#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| +} |
| + |
| bool AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) { |
| std::string guid; |
| size_t variant = 0; |