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

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

Issue 1028163002: Processing USERNAME reply from Autofill server in Password Manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 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 17 matching lines...) Expand all
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,
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
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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 else if (is_server_data_available_ && !is_local_data_available_) 752 else if (is_server_data_available_ && !is_local_data_available_)
748 name += ".WithOnlyServerData"; 753 name += ".WithOnlyServerData";
749 else if (!is_server_data_available_ && is_local_data_available_) 754 else if (!is_server_data_available_ && is_local_data_available_)
750 name += ".WithOnlyLocalData"; 755 name += ".WithOnlyLocalData";
751 else 756 else
752 name += ".WithBothServerAndLocalData"; 757 name += ".WithBothServerAndLocalData";
753 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); 758 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS);
754 } 759 }
755 760
756 } // namespace autofill 761 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.cc ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698