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 17 matching lines...) Expand all Loading... | |
28 GROUP_ADDRESS_COUNTRY, | 28 GROUP_ADDRESS_COUNTRY, |
29 GROUP_PHONE, | 29 GROUP_PHONE, |
30 GROUP_FAX, // Deprecated. | 30 GROUP_FAX, // Deprecated. |
31 GROUP_EMAIL, | 31 GROUP_EMAIL, |
32 GROUP_CREDIT_CARD_NAME, | 32 GROUP_CREDIT_CARD_NAME, |
33 GROUP_CREDIT_CARD_NUMBER, | 33 GROUP_CREDIT_CARD_NUMBER, |
34 GROUP_CREDIT_CARD_DATE, | 34 GROUP_CREDIT_CARD_DATE, |
35 GROUP_CREDIT_CARD_TYPE, | 35 GROUP_CREDIT_CARD_TYPE, |
36 GROUP_PASSWORD, | 36 GROUP_PASSWORD, |
37 GROUP_ADDRESS_LINE_3, | 37 GROUP_ADDRESS_LINE_3, |
38 GROUP_USERNAME, | |
Ilya Sherman
2015/03/26 00:30:04
Please update histograms.xml for this change.
dvadym
2015/03/26 12:29:13
I've added in one place in histograms.xml about us
Ilya Sherman
2015/03/31 00:45:04
Yes, thanks :)
| |
38 NUM_FIELD_TYPE_GROUPS_FOR_METRICS | 39 NUM_FIELD_TYPE_GROUPS_FOR_METRICS |
39 }; | 40 }; |
40 | 41 |
41 } // namespace | 42 } // namespace |
42 | 43 |
43 // First, translates |field_type| to the corresponding logical |group| from | 44 // First, translates |field_type| to the corresponding logical |group| from |
44 // |FieldTypeGroupForMetrics|. Then, interpolates this with the given |metric|, | 45 // |FieldTypeGroupForMetrics|. Then, interpolates this with the given |metric|, |
45 // which should be in the range [0, |num_possible_metrics|). | 46 // which should be in the range [0, |num_possible_metrics|). |
46 // Returns the interpolated index. | 47 // Returns the interpolated index. |
47 // | 48 // |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 NOTREACHED(); | 147 NOTREACHED(); |
147 group = GROUP_AMBIGUOUS; | 148 group = GROUP_AMBIGUOUS; |
148 break; | 149 break; |
149 } | 150 } |
150 break; | 151 break; |
151 | 152 |
152 case PASSWORD_FIELD: | 153 case PASSWORD_FIELD: |
153 group = GROUP_PASSWORD; | 154 group = GROUP_PASSWORD; |
154 break; | 155 break; |
155 | 156 |
157 case USERNAME_FIELD: | |
158 group = GROUP_USERNAME; | |
159 break; | |
160 | |
156 case TRANSACTION: | 161 case TRANSACTION: |
157 NOTREACHED(); | 162 NOTREACHED(); |
158 break; | 163 break; |
159 } | 164 } |
160 | 165 |
161 // Interpolate the |metric| with the |group|, so that all metrics for a given | 166 // Interpolate the |metric| with the |group|, so that all metrics for a given |
162 // |group| are adjacent. | 167 // |group| are adjacent. |
163 return (group * AutofillMetrics::NUM_FIELD_TYPE_QUALITY_METRICS) + metric; | 168 return (group * AutofillMetrics::NUM_FIELD_TYPE_QUALITY_METRICS) + metric; |
164 } | 169 } |
165 | 170 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 else if (is_server_data_available_ && !is_local_data_available_) | 609 else if (is_server_data_available_ && !is_local_data_available_) |
605 name += ".WithOnlyServerData"; | 610 name += ".WithOnlyServerData"; |
606 else if (!is_server_data_available_ && is_local_data_available_) | 611 else if (!is_server_data_available_ && is_local_data_available_) |
607 name += ".WithOnlyLocalData"; | 612 name += ".WithOnlyLocalData"; |
608 else | 613 else |
609 name += ".WithBothServerAndLocalData"; | 614 name += ".WithBothServerAndLocalData"; |
610 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); | 615 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); |
611 } | 616 } |
612 | 617 |
613 } // namespace autofill | 618 } // namespace autofill |
OLD | NEW |