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

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

Issue 1130773004: mac: Add histograms to measure impact of Address Book integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 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;

Powered by Google App Engine
This is Rietveld 408576698