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

Side by Side Diff: components/autofill/core/browser/autofill_metrics.cc

Issue 2111863002: [Autofill] Debounce suggestions poll user actions for the same field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/browser/autofill_metrics.h" 5 #include "components/autofill/core/browser/autofill_metrics.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 logged_suggestion_filled_was_masked_server_card_(false) { 624 logged_suggestion_filled_was_masked_server_card_(false) {
625 } 625 }
626 626
627 void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() { 627 void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() {
628 if (!has_logged_interacted_) { 628 if (!has_logged_interacted_) {
629 has_logged_interacted_ = true; 629 has_logged_interacted_ = true;
630 Log(AutofillMetrics::FORM_EVENT_INTERACTED_ONCE); 630 Log(AutofillMetrics::FORM_EVENT_INTERACTED_ONCE);
631 } 631 }
632 } 632 }
633 633
634 void AutofillMetrics::FormEventLogger::OnDidPollSuggestions() { 634 void AutofillMetrics::FormEventLogger::OnDidPollSuggestions(
635 if (is_for_credit_card_) { 635 const FormFieldData& field) {
636 base::RecordAction( 636 // Record only one poll user action for consecutive polls of the same field.
637 base::UserMetricsAction("Autofill_PolledCreditCardSuggestions")); 637 // This is to avoid recording too many poll actions (for example when a user
638 } else { 638 // types in a field, triggering multiple queries) to make the analysis more
639 base::RecordAction( 639 // simple.
640 base::UserMetricsAction("Autofill_PolledProfileSuggestions")); 640 if (!field.SameFieldAs(last_polled_field_)) {
641 if (is_for_credit_card_) {
642 base::RecordAction(
643 base::UserMetricsAction("Autofill_PolledCreditCardSuggestions"));
644 } else {
645 base::RecordAction(
646 base::UserMetricsAction("Autofill_PolledProfileSuggestions"));
647 }
648
649 last_polled_field_ = field;
641 } 650 }
642 } 651 }
643 652
644 void AutofillMetrics::FormEventLogger::OnDidShowSuggestions() { 653 void AutofillMetrics::FormEventLogger::OnDidShowSuggestions() {
645 Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN); 654 Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN);
646 if (!has_logged_suggestions_shown_) { 655 if (!has_logged_suggestions_shown_) {
647 has_logged_suggestions_shown_ = true; 656 has_logged_suggestions_shown_ = true;
648 Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN_ONCE); 657 Log(AutofillMetrics::FORM_EVENT_SUGGESTIONS_SHOWN_ONCE);
649 } 658 }
650 659
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 else if (is_server_data_available_ && !is_local_data_available_) 793 else if (is_server_data_available_ && !is_local_data_available_)
785 name += ".WithOnlyServerData"; 794 name += ".WithOnlyServerData";
786 else if (!is_server_data_available_ && is_local_data_available_) 795 else if (!is_server_data_available_ && is_local_data_available_)
787 name += ".WithOnlyLocalData"; 796 name += ".WithOnlyLocalData";
788 else 797 else
789 name += ".WithBothServerAndLocalData"; 798 name += ".WithBothServerAndLocalData";
790 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); 799 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS);
791 } 800 }
792 801
793 } // namespace autofill 802 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.h ('k') | components/autofill/core/browser/autofill_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698