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

Unified Diff: components/autofill/core/browser/autofill_metrics.cc

Issue 23629046: Remove default case from autofill_metrics.cc::GetFieldTypeGroupMetric (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Appease foolish compiler Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_metrics.cc
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc
index 14d8a646e7d2dff3054c2894e24257919f3e92fb..930783d93b5ede89135abcd72d843bd0bd3344bc 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -56,6 +56,7 @@ enum FieldTypeGroupForMetrics {
CREDIT_CARD_NUMBER,
CREDIT_CARD_DATE,
CREDIT_CARD_TYPE,
+ PASSWORD,
NUM_FIELD_TYPE_GROUPS_FOR_METRICS
};
@@ -85,13 +86,14 @@ int GetFieldTypeGroupMetric(const ServerFieldType field_type,
const int num_possible_metrics) {
DCHECK_LT(metric, num_possible_metrics);
- FieldTypeGroupForMetrics group;
+ FieldTypeGroupForMetrics group = AMBIGUOUS;
switch (AutofillType(field_type).group()) {
case ::autofill::NO_GROUP:
group = AMBIGUOUS;
break;
case ::autofill::NAME:
+ case ::autofill::NAME_BILLING:
group = NAME;
break;
@@ -100,7 +102,8 @@ int GetFieldTypeGroupMetric(const ServerFieldType field_type,
break;
case ::autofill::ADDRESS_HOME:
- switch (field_type) {
+ case ::autofill::ADDRESS_BILLING:
+ switch (AutofillType(field_type).GetStorableType()) {
case ADDRESS_HOME_LINE1:
group = ADDRESS_LINE_1;
break;
@@ -122,6 +125,7 @@ int GetFieldTypeGroupMetric(const ServerFieldType field_type,
default:
NOTREACHED();
group = AMBIGUOUS;
+ break;
}
break;
@@ -130,6 +134,7 @@ int GetFieldTypeGroupMetric(const ServerFieldType field_type,
break;
case ::autofill::PHONE_HOME:
+ case ::autofill::PHONE_BILLING:
group = PHONE;
break;
@@ -144,14 +149,23 @@ int GetFieldTypeGroupMetric(const ServerFieldType field_type,
case ::autofill::CREDIT_CARD_TYPE:
group = CREDIT_CARD_TYPE;
break;
- default:
+ case ::autofill::CREDIT_CARD_EXP_MONTH:
+ case ::autofill::CREDIT_CARD_EXP_2_DIGIT_YEAR:
+ case ::autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR:
+ case ::autofill::CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR:
+ case ::autofill::CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR:
group = CREDIT_CARD_DATE;
+ break;
+ default:
+ NOTREACHED();
+ group = AMBIGUOUS;
+ break;
}
break;
- default:
- NOTREACHED();
- group = AMBIGUOUS;
+ case ::autofill::PASSWORD_FIELD:
+ group = PASSWORD;
+ break;
}
// Interpolate the |metric| with the |group|, so that all metrics for a given
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698