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

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

Issue 1821053002: [Autofill] Disambiguate similar types before uploading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 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 #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 13 matching lines...) Expand all
24 GROUP_COMPANY, 24 GROUP_COMPANY,
25 GROUP_ADDRESS_LINE_1, 25 GROUP_ADDRESS_LINE_1,
26 GROUP_ADDRESS_LINE_2, 26 GROUP_ADDRESS_LINE_2,
27 GROUP_ADDRESS_CITY, 27 GROUP_ADDRESS_CITY,
28 GROUP_ADDRESS_STATE, 28 GROUP_ADDRESS_STATE,
29 GROUP_ADDRESS_ZIP, 29 GROUP_ADDRESS_ZIP,
30 GROUP_ADDRESS_COUNTRY, 30 GROUP_ADDRESS_COUNTRY,
31 GROUP_PHONE, 31 GROUP_PHONE,
32 GROUP_FAX, // Deprecated. 32 GROUP_FAX, // Deprecated.
33 GROUP_EMAIL, 33 GROUP_EMAIL,
34 GROUP_CREDIT_CARD_NAME_FULL, 34 GROUP_CREDIT_CARD_NAME,
35 GROUP_CREDIT_CARD_NUMBER, 35 GROUP_CREDIT_CARD_NUMBER,
36 GROUP_CREDIT_CARD_DATE, 36 GROUP_CREDIT_CARD_DATE,
37 GROUP_CREDIT_CARD_TYPE, 37 GROUP_CREDIT_CARD_TYPE,
38 GROUP_PASSWORD, 38 GROUP_PASSWORD,
39 GROUP_ADDRESS_LINE_3, 39 GROUP_ADDRESS_LINE_3,
40 GROUP_USERNAME, 40 GROUP_USERNAME,
41 GROUP_STREET_ADDRESS,
41 NUM_FIELD_TYPE_GROUPS_FOR_METRICS 42 NUM_FIELD_TYPE_GROUPS_FOR_METRICS
42 }; 43 };
43 44
44 } // namespace 45 } // namespace
45 46
46 // First, translates |field_type| to the corresponding logical |group| from 47 // First, translates |field_type| to the corresponding logical |group| from
47 // |FieldTypeGroupForMetrics|. Then, interpolates this with the given |metric|, 48 // |FieldTypeGroupForMetrics|. Then, interpolates this with the given |metric|,
48 // which should be in the range [0, |num_possible_metrics|). 49 // which should be in the range [0, |num_possible_metrics|).
49 // Returns the interpolated index. 50 // Returns the interpolated index.
50 // 51 //
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 switch (AutofillType(field_type).GetStorableType()) { 93 switch (AutofillType(field_type).GetStorableType()) {
93 case ADDRESS_HOME_LINE1: 94 case ADDRESS_HOME_LINE1:
94 group = GROUP_ADDRESS_LINE_1; 95 group = GROUP_ADDRESS_LINE_1;
95 break; 96 break;
96 case ADDRESS_HOME_LINE2: 97 case ADDRESS_HOME_LINE2:
97 group = GROUP_ADDRESS_LINE_2; 98 group = GROUP_ADDRESS_LINE_2;
98 break; 99 break;
99 case ADDRESS_HOME_LINE3: 100 case ADDRESS_HOME_LINE3:
100 group = GROUP_ADDRESS_LINE_3; 101 group = GROUP_ADDRESS_LINE_3;
101 break; 102 break;
103 case ADDRESS_HOME_STREET_ADDRESS:
104 group = GROUP_STREET_ADDRESS;
102 case ADDRESS_HOME_CITY: 105 case ADDRESS_HOME_CITY:
103 group = GROUP_ADDRESS_CITY; 106 group = GROUP_ADDRESS_CITY;
104 break; 107 break;
105 case ADDRESS_HOME_STATE: 108 case ADDRESS_HOME_STATE:
106 group = GROUP_ADDRESS_STATE; 109 group = GROUP_ADDRESS_STATE;
107 break; 110 break;
108 case ADDRESS_HOME_ZIP: 111 case ADDRESS_HOME_ZIP:
109 group = GROUP_ADDRESS_ZIP; 112 group = GROUP_ADDRESS_ZIP;
110 break; 113 break;
111 case ADDRESS_HOME_COUNTRY: 114 case ADDRESS_HOME_COUNTRY:
(...skipping 11 matching lines...) Expand all
123 break; 126 break;
124 127
125 case PHONE_HOME: 128 case PHONE_HOME:
126 case PHONE_BILLING: 129 case PHONE_BILLING:
127 group = GROUP_PHONE; 130 group = GROUP_PHONE;
128 break; 131 break;
129 132
130 case CREDIT_CARD: 133 case CREDIT_CARD:
131 switch (field_type) { 134 switch (field_type) {
132 case CREDIT_CARD_NAME_FULL: 135 case CREDIT_CARD_NAME_FULL:
133 group = GROUP_CREDIT_CARD_NAME_FULL; 136 case CREDIT_CARD_NAME_FIRST:
137 case CREDIT_CARD_NAME_LAST:
138 group = GROUP_CREDIT_CARD_NAME;
134 break; 139 break;
135 case CREDIT_CARD_NUMBER: 140 case CREDIT_CARD_NUMBER:
136 group = GROUP_CREDIT_CARD_NUMBER; 141 group = GROUP_CREDIT_CARD_NUMBER;
137 break; 142 break;
138 case CREDIT_CARD_TYPE: 143 case CREDIT_CARD_TYPE:
139 group = GROUP_CREDIT_CARD_TYPE; 144 group = GROUP_CREDIT_CARD_TYPE;
140 break; 145 break;
141 case CREDIT_CARD_EXP_MONTH: 146 case CREDIT_CARD_EXP_MONTH:
142 case CREDIT_CARD_EXP_2_DIGIT_YEAR: 147 case CREDIT_CARD_EXP_2_DIGIT_YEAR:
143 case CREDIT_CARD_EXP_4_DIGIT_YEAR: 148 case CREDIT_CARD_EXP_4_DIGIT_YEAR:
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 else if (is_server_data_available_ && !is_local_data_available_) 845 else if (is_server_data_available_ && !is_local_data_available_)
841 name += ".WithOnlyServerData"; 846 name += ".WithOnlyServerData";
842 else if (!is_server_data_available_ && is_local_data_available_) 847 else if (!is_server_data_available_ && is_local_data_available_)
843 name += ".WithOnlyLocalData"; 848 name += ".WithOnlyLocalData";
844 else 849 else
845 name += ".WithBothServerAndLocalData"; 850 name += ".WithBothServerAndLocalData";
846 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); 851 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS);
847 } 852 }
848 853
849 } // namespace autofill 854 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager_unittest.cc ('k') | components/autofill/core/browser/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698