OLD | NEW |
---|---|
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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
558 if (!has_logged_suggestion_filled_) { | 558 if (!has_logged_suggestion_filled_) { |
559 has_logged_suggestion_filled_ = true; | 559 has_logged_suggestion_filled_ = true; |
560 logged_suggestion_filled_was_server_data_ = | 560 logged_suggestion_filled_was_server_data_ = |
561 profile.record_type() == AutofillProfile::SERVER_PROFILE; | 561 profile.record_type() == AutofillProfile::SERVER_PROFILE; |
562 Log(profile.record_type() == AutofillProfile::SERVER_PROFILE | 562 Log(profile.record_type() == AutofillProfile::SERVER_PROFILE |
563 ? AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_FILLED_ONCE | 563 ? AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_FILLED_ONCE |
564 : AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_FILLED_ONCE); | 564 : AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_FILLED_ONCE); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 void AutofillMetrics::FormEventLogger::OnWillSubmitForm() { | |
569 // Not logging this kind of form if we haven't logged a user interaction. | |
570 if (!has_logged_interacted_) | |
571 return; | |
572 | |
573 Log(AutofillMetrics::FORM_EVENT_WILL_SUBMIT); | |
Ilya Sherman
2015/03/18 22:42:10
Should this event be logged only once, as below?
Mathieu
2015/03/23 15:24:02
+walter
I wanted to capture all OnWillSubmit even
Walter Cacau
2015/03/23 19:06:37
The idea was that we were tracking the basic user
| |
574 } | |
575 | |
568 void AutofillMetrics::FormEventLogger::OnDidSubmitForm() { | 576 void AutofillMetrics::FormEventLogger::OnDidSubmitForm() { |
569 // Not logging this kind of form if we haven't logged a user interaction. | 577 // Not logging this kind of form if we haven't logged a user interaction. |
570 if (!has_logged_interacted_) | 578 if (!has_logged_interacted_) |
571 return; | 579 return; |
572 | 580 |
573 // Not logging twice. | 581 // Not logging twice. |
574 if (has_logged_submitted_) | 582 if (has_logged_submitted_) |
575 return; | 583 return; |
576 has_logged_submitted_ = true; | 584 has_logged_submitted_ = true; |
577 | 585 |
(...skipping 26 matching lines...) Expand all Loading... | |
604 else if (is_server_data_available_ && !is_local_data_available_) | 612 else if (is_server_data_available_ && !is_local_data_available_) |
605 name += ".WithOnlyServerData"; | 613 name += ".WithOnlyServerData"; |
606 else if (!is_server_data_available_ && is_local_data_available_) | 614 else if (!is_server_data_available_ && is_local_data_available_) |
607 name += ".WithOnlyLocalData"; | 615 name += ".WithOnlyLocalData"; |
608 else | 616 else |
609 name += ".WithBothServerAndLocalData"; | 617 name += ".WithBothServerAndLocalData"; |
610 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); | 618 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); |
611 } | 619 } |
612 | 620 |
613 } // namespace autofill | 621 } // namespace autofill |
OLD | NEW |