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..a5c7dcd5edd62388de0180ea05b13c330a1ede52 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_macros.h" |
| #include "base/prefs/pref_service.h" |
| #include "base/strings/string16.h" |
| #include "base/strings/string_util.h" |
| @@ -700,6 +701,22 @@ 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); |
|
Ilya Sherman
2015/05/18 21:36:22
Rather than changing the test code, I think the pr
erikchen
2015/05/18 23:29:40
It does not resolve all of the test failures.
I
Ilya Sherman
2015/05/18 23:31:23
It's not an opaque object. What does your code do
|
| + if (!result) |
| + return; |
| + |
| + bool is_from_address_book = |
| + profile->record_type() == AutofillProfile::AUXILIARY_PROFILE; |
| + UMA_HISTOGRAM_BOOLEAN( |
| + "Autofill.MacAddressBook.AcceptedSuggestionIsFromAddressBook", |
| + is_from_address_book); |
| +#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| +} |
| + |
| bool AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) { |
| std::string guid; |
| size_t variant = 0; |