| 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 "chrome/browser/autofill/autofill_type.h" | 10 #include "chrome/browser/autofill/autofill_type.h" |
| 10 #include "chrome/browser/autofill/form_structure.h" | 11 #include "chrome/browser/autofill/form_structure.h" |
| 11 #include "webkit/glue/form_data.h" | 12 #include "webkit/glue/form_data.h" |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 // Server experiments we support. | 16 // Server experiments we support. |
| 16 enum ServerExperiment { | 17 enum ServerExperiment { |
| 17 NO_EXPERIMENT = 0, | 18 NO_EXPERIMENT = 0, |
| 18 UNKNOWN_EXPERIMENT, | 19 UNKNOWN_EXPERIMENT, |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 NUM_SERVER_QUERY_METRICS); | 289 NUM_SERVER_QUERY_METRICS); |
| 289 } | 290 } |
| 290 | 291 |
| 291 void AutofillMetrics::LogUserHappinessMetric(UserHappinessMetric metric) const { | 292 void AutofillMetrics::LogUserHappinessMetric(UserHappinessMetric metric) const { |
| 292 DCHECK(metric < NUM_USER_HAPPINESS_METRICS); | 293 DCHECK(metric < NUM_USER_HAPPINESS_METRICS); |
| 293 | 294 |
| 294 UMA_HISTOGRAM_ENUMERATION("Autofill.UserHappiness", metric, | 295 UMA_HISTOGRAM_ENUMERATION("Autofill.UserHappiness", metric, |
| 295 NUM_USER_HAPPINESS_METRICS); | 296 NUM_USER_HAPPINESS_METRICS); |
| 296 } | 297 } |
| 297 | 298 |
| 299 void AutofillMetrics::LogAutofilledFormSubmittedAfterDuration( |
| 300 const base::TimeDelta& duration) const { |
| 301 UMA_HISTOGRAM_TIMES("Autofill.FormFillTime.WithAutofill", duration); |
| 302 } |
| 303 |
| 304 void AutofillMetrics::LogNonAutofilledFormSubmittedAfterDuration( |
| 305 const base::TimeDelta& duration) const { |
| 306 UMA_HISTOGRAM_TIMES("Autofill.FormFillTime.WithoutAutofill", duration); |
| 307 } |
| 308 |
| 298 void AutofillMetrics::LogIsAutofillEnabledAtStartup(bool enabled) const { | 309 void AutofillMetrics::LogIsAutofillEnabledAtStartup(bool enabled) const { |
| 299 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.Startup", enabled); | 310 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.Startup", enabled); |
| 300 } | 311 } |
| 301 | 312 |
| 302 void AutofillMetrics::LogIsAutofillEnabledAtPageLoad(bool enabled) const { | 313 void AutofillMetrics::LogIsAutofillEnabledAtPageLoad(bool enabled) const { |
| 303 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.PageLoad", enabled); | 314 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.PageLoad", enabled); |
| 304 } | 315 } |
| 305 | 316 |
| 306 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) const { | 317 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) const { |
| 307 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); | 318 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); |
| 308 } | 319 } |
| 309 | 320 |
| 310 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) const { | 321 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) const { |
| 311 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); | 322 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); |
| 312 } | 323 } |
| 313 | 324 |
| 314 void AutofillMetrics::LogServerExperimentIdForQuery( | 325 void AutofillMetrics::LogServerExperimentIdForQuery( |
| 315 const std::string& experiment_id) const { | 326 const std::string& experiment_id) const { |
| 316 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); | 327 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); |
| 317 } | 328 } |
| 318 | 329 |
| 319 void AutofillMetrics::LogServerExperimentIdForUpload( | 330 void AutofillMetrics::LogServerExperimentIdForUpload( |
| 320 const std::string& experiment_id) const { | 331 const std::string& experiment_id) const { |
| 321 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); | 332 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); |
| 322 } | 333 } |
| OLD | NEW |