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

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

Issue 884843002: Recording in UMA when a user interacted with an address form or a credit card form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: inlining web_profiles() call Created 5 years, 10 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 // static 458 // static
459 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) { 459 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) {
460 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); 460 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles);
461 } 461 }
462 462
463 // static 463 // static
464 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) { 464 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) {
465 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); 465 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions);
466 } 466 }
467 467
468 AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card)
469 : is_for_credit_card_(is_for_credit_card),
470 is_server_data_available_(false),
471 is_local_data_available_(false),
472 has_logged_interacted_(false) {};
473
474 void AutofillMetrics::FormEventLogger::OnDidInteractWithAutofillableForm() {
475 if (!has_logged_interacted_) {
476 has_logged_interacted_ = true;
477 Log(AutofillMetrics::FORM_EVENT_INTERACTED_ONCE);
478 }
479 }
480
481 void AutofillMetrics::FormEventLogger::Log(FormEvent event) const {
482 DCHECK_LT(event, NUM_FORM_EVENTS);
483 std::string name("Autofill.FormEvents.");
484 if (is_for_credit_card_)
485 name += "CreditCard";
486 else
487 name += "Address";
488 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS);
489
490 // Logging again in a different histogram for segmentation purposes.
491 // TODO(waltercacau): Re-evaluate if we still need such fine grained
492 // segmentation. http://crbug.com/454018
493 if (!is_server_data_available_ && !is_local_data_available_)
494 name += ".WithNoData";
495 else if (is_server_data_available_ && !is_local_data_available_)
496 name += ".WithOnlyServerData";
497 else if (!is_server_data_available_ && is_local_data_available_)
498 name += ".WithOnlyLocalData";
499 else
500 name += ".WithBothServerAndLocalData";
501 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS);
502 }
503
468 } // namespace autofill 504 } // 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