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

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

Issue 2740633002: [Autofill] Add upstreaming UKM (Closed)
Patch Set: Addressed comments Created 3 years, 9 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "components/autofill/core/browser/autofill_client.h" 12 #include "components/autofill/core/browser/autofill_client.h"
13 #include "components/autofill/core/browser/autofill_profile.h" 13 #include "components/autofill/core/browser/autofill_profile.h"
14 #include "components/autofill/core/browser/credit_card.h" 14 #include "components/autofill/core/browser/credit_card.h"
15 #include "components/autofill/core/browser/field_types.h" 15 #include "components/autofill/core/browser/field_types.h"
16 #include "components/autofill/core/common/form_field_data.h" 16 #include "components/autofill/core/common/form_field_data.h"
17 17
18 namespace base { 18 namespace base {
19 class TimeDelta; 19 class TimeDelta;
20 } 20 } // namespace base
21
22 namespace ukm {
23 class UkmService;
24 } // namespace ukm
21 25
22 namespace autofill { 26 namespace autofill {
23 27
24 class AutofillMetrics { 28 class AutofillMetrics {
25 public: 29 public:
26 enum AutofillProfileAction { 30 enum AutofillProfileAction {
27 EXISTING_PROFILE_USED, 31 EXISTING_PROFILE_USED,
28 EXISTING_PROFILE_UPDATED, 32 EXISTING_PROFILE_UPDATED,
29 NEW_PROFILE_CREATED, 33 NEW_PROFILE_CREATED,
30 AUTOFILL_PROFILE_ACTION_ENUM_SIZE, 34 AUTOFILL_PROFILE_ACTION_ENUM_SIZE,
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 static void LogIsQueriedCreditCardFormSecure(bool is_secure); 677 static void LogIsQueriedCreditCardFormSecure(bool is_secure);
674 678
675 // Log how the converted wallet address was added to the local autofill 679 // Log how the converted wallet address was added to the local autofill
676 // profiles. 680 // profiles.
677 static void LogWalletAddressConversionType(WalletAddressConversionType type); 681 static void LogWalletAddressConversionType(WalletAddressConversionType type);
678 682
679 // This should be called when the user selects the Form-Not-Secure warning 683 // This should be called when the user selects the Form-Not-Secure warning
680 // suggestion to show an explanation of the warning. 684 // suggestion to show an explanation of the warning.
681 static void LogShowedHttpNotSecureExplanation(); 685 static void LogShowedHttpNotSecureExplanation();
682 686
687 // Logs the the |ukm| with the specified |url| and the specified |metrics|.
688 // Returns whether the ukm was sucessfully logged.
689 static bool LogUkm(ukm::UkmService* ukm_service,
690 const GURL& url,
691 const std::string& ukm,
692 const std::map<std::string, int>& metrics);
693
683 // Utility to autofill form events in the relevant histograms depending on 694 // Utility to autofill form events in the relevant histograms depending on
684 // the presence of server and/or local data. 695 // the presence of server and/or local data.
685 class FormEventLogger { 696 class FormEventLogger {
686 public: 697 public:
687 FormEventLogger(bool is_for_credit_card); 698 FormEventLogger(bool is_for_credit_card);
688 699
689 inline void set_is_server_data_available(bool is_server_data_available) { 700 inline void set_is_server_data_available(bool is_server_data_available) {
690 is_server_data_available_ = is_server_data_available; 701 is_server_data_available_ = is_server_data_available;
691 } 702 }
692 703
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 FormFieldData last_polled_field_; 747 FormFieldData last_polled_field_;
737 }; 748 };
738 749
739 private: 750 private:
740 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); 751 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics);
741 }; 752 };
742 753
743 } // namespace autofill 754 } // namespace autofill
744 755
745 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ 756 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698