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

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: Fix some unit tests. 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..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;
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/personal_data_manager_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698