Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/autofill/autofill_metrics.h" | 5 #include "chrome/browser/autofill/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/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/autofill/autofill_type.h" | 10 #include "chrome/browser/autofill/autofill_type.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 AMBIGUOUS = 0, | 35 AMBIGUOUS = 0, |
| 36 NAME, | 36 NAME, |
| 37 COMPANY, | 37 COMPANY, |
| 38 ADDRESS_LINE_1, | 38 ADDRESS_LINE_1, |
| 39 ADDRESS_LINE_2, | 39 ADDRESS_LINE_2, |
| 40 ADDRESS_CITY, | 40 ADDRESS_CITY, |
| 41 ADDRESS_STATE, | 41 ADDRESS_STATE, |
| 42 ADDRESS_ZIP, | 42 ADDRESS_ZIP, |
| 43 ADDRESS_COUNTRY, | 43 ADDRESS_COUNTRY, |
| 44 PHONE, | 44 PHONE, |
| 45 FAX, | |
|
Ilya Sherman
2011/09/15 03:47:08
Please leave this in and add a comment that it is
James Hawkins
2011/09/16 03:23:28
Done.
| |
| 46 EMAIL, | 45 EMAIL, |
| 47 CREDIT_CARD_NAME, | 46 CREDIT_CARD_NAME, |
| 48 CREDIT_CARD_NUMBER, | 47 CREDIT_CARD_NUMBER, |
| 49 CREDIT_CARD_DATE, | 48 CREDIT_CARD_DATE, |
| 50 NUM_FIELD_TYPE_GROUPS_FOR_METRICS | 49 NUM_FIELD_TYPE_GROUPS_FOR_METRICS |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 // First, translates |field_type| to the corresponding logical |group| from | 52 // First, translates |field_type| to the corresponding logical |group| from |
| 54 // |FieldTypeGroupForMetrics|. Then, interpolates this with the given |metric|, | 53 // |FieldTypeGroupForMetrics|. Then, interpolates this with the given |metric|, |
| 55 // which should be in the range [0, |num_possible_metrics|). | 54 // which should be in the range [0, |num_possible_metrics|). |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 break; | 116 break; |
| 118 | 117 |
| 119 case AutofillType::EMAIL: | 118 case AutofillType::EMAIL: |
| 120 group = EMAIL; | 119 group = EMAIL; |
| 121 break; | 120 break; |
| 122 | 121 |
| 123 case AutofillType::PHONE_HOME: | 122 case AutofillType::PHONE_HOME: |
| 124 group = PHONE; | 123 group = PHONE; |
| 125 break; | 124 break; |
| 126 | 125 |
| 127 case AutofillType::PHONE_FAX: | |
| 128 group = FAX; | |
| 129 break; | |
| 130 | |
| 131 case AutofillType::CREDIT_CARD: | 126 case AutofillType::CREDIT_CARD: |
| 132 switch (field_type) { | 127 switch (field_type) { |
| 133 case ::CREDIT_CARD_NAME: | 128 case ::CREDIT_CARD_NAME: |
| 134 group = CREDIT_CARD_NAME; | 129 group = CREDIT_CARD_NAME; |
| 135 break; | 130 break; |
| 136 case ::CREDIT_CARD_NUMBER: | 131 case ::CREDIT_CARD_NUMBER: |
| 137 group = CREDIT_CARD_NUMBER; | 132 group = CREDIT_CARD_NUMBER; |
| 138 break; | 133 break; |
| 139 default: | 134 default: |
| 140 group = CREDIT_CARD_DATE; | 135 group = CREDIT_CARD_DATE; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 | 350 |
| 356 void AutofillMetrics::LogServerExperimentIdForQuery( | 351 void AutofillMetrics::LogServerExperimentIdForQuery( |
| 357 const std::string& experiment_id) const { | 352 const std::string& experiment_id) const { |
| 358 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); | 353 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); |
| 359 } | 354 } |
| 360 | 355 |
| 361 void AutofillMetrics::LogServerExperimentIdForUpload( | 356 void AutofillMetrics::LogServerExperimentIdForUpload( |
| 362 const std::string& experiment_id) const { | 357 const std::string& experiment_id) const { |
| 363 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); | 358 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); |
| 364 } | 359 } |
| OLD | NEW |