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 <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 // static | 292 // static |
293 void AutofillMetrics::LogCardUploadDecisionMetric( | 293 void AutofillMetrics::LogCardUploadDecisionMetric( |
294 CardUploadDecisionMetric metric) { | 294 CardUploadDecisionMetric metric) { |
295 DCHECK_LT(metric, NUM_CARD_UPLOAD_DECISION_METRICS); | 295 DCHECK_LT(metric, NUM_CARD_UPLOAD_DECISION_METRICS); |
296 UMA_HISTOGRAM_ENUMERATION("Autofill.CardUploadDecisionExpanded", metric, | 296 UMA_HISTOGRAM_ENUMERATION("Autofill.CardUploadDecisionExpanded", metric, |
297 NUM_CARD_UPLOAD_DECISION_METRICS); | 297 NUM_CARD_UPLOAD_DECISION_METRICS); |
298 } | 298 } |
299 | 299 |
300 // static | 300 // static |
301 void AutofillMetrics::LogCreditCardInfoBarMetric(InfoBarMetric metric, | 301 void AutofillMetrics::LogCreditCardInfoBarMetric( |
302 bool is_uploading) { | 302 InfoBarMetric metric, |
| 303 bool is_uploading, |
| 304 bool did_user_accept_previous_save_credit_card_prompt) { |
303 DCHECK_LT(metric, NUM_INFO_BAR_METRICS); | 305 DCHECK_LT(metric, NUM_INFO_BAR_METRICS); |
304 if (is_uploading) { | 306 std::string destination = is_uploading ? ".Server" : ".Local"; |
305 UMA_HISTOGRAM_ENUMERATION("Autofill.CreditCardInfoBar.Server", metric, | 307 std::string previous_response = |
306 NUM_INFO_BAR_METRICS); | 308 did_user_accept_previous_save_credit_card_prompt ? ".PreviouslyAccepted" |
307 } else { | 309 : ".PreviouslyDenied"; |
308 UMA_HISTOGRAM_ENUMERATION("Autofill.CreditCardInfoBar.Local", metric, | 310 LogUMAHistogramEnumeration( |
309 NUM_INFO_BAR_METRICS); | 311 "Autofill.CreditCardInfoBar" + destination + previous_response, metric, |
310 } | 312 NUM_INFO_BAR_METRICS); |
311 } | 313 } |
312 | 314 |
313 // static | 315 // static |
314 void AutofillMetrics::LogCreditCardFillingInfoBarMetric(InfoBarMetric metric) { | 316 void AutofillMetrics::LogCreditCardFillingInfoBarMetric(InfoBarMetric metric) { |
315 DCHECK_LT(metric, NUM_INFO_BAR_METRICS); | 317 DCHECK_LT(metric, NUM_INFO_BAR_METRICS); |
316 UMA_HISTOGRAM_ENUMERATION("Autofill.CreditCardFillingInfoBar", metric, | 318 UMA_HISTOGRAM_ENUMERATION("Autofill.CreditCardFillingInfoBar", metric, |
317 NUM_INFO_BAR_METRICS); | 319 NUM_INFO_BAR_METRICS); |
318 } | 320 } |
319 | 321 |
320 // static | 322 // static |
321 void AutofillMetrics::LogSaveCardPromptMetric(SaveCardPromptMetric metric, | 323 void AutofillMetrics::LogSaveCardPromptMetric( |
322 bool is_uploading, | 324 SaveCardPromptMetric metric, |
323 bool is_reshow) { | 325 bool is_uploading, |
| 326 bool is_reshow, |
| 327 bool did_user_accept_previous_save_credit_card_prompt) { |
324 DCHECK_LT(metric, NUM_SAVE_CARD_PROMPT_METRICS); | 328 DCHECK_LT(metric, NUM_SAVE_CARD_PROMPT_METRICS); |
325 std::string destination = is_uploading ? ".Upload" : ".Local"; | 329 std::string destination = is_uploading ? ".Upload" : ".Local"; |
326 std::string show = is_reshow ? ".Reshows" : ".FirstShow"; | 330 std::string show = is_reshow ? ".Reshows" : ".FirstShow"; |
| 331 std::string previous_response = |
| 332 did_user_accept_previous_save_credit_card_prompt ? ".PreviouslyAccepted" |
| 333 : ".PreviouslyDenied"; |
327 LogUMAHistogramEnumeration( | 334 LogUMAHistogramEnumeration( |
328 "Autofill.SaveCreditCardPrompt" + destination + show, metric, | 335 "Autofill.SaveCreditCardPrompt" + destination + show + previous_response, |
329 NUM_SAVE_CARD_PROMPT_METRICS); | 336 metric, NUM_SAVE_CARD_PROMPT_METRICS); |
330 } | 337 } |
331 | 338 |
332 // static | 339 // static |
333 void AutofillMetrics::LogScanCreditCardPromptMetric( | 340 void AutofillMetrics::LogScanCreditCardPromptMetric( |
334 ScanCreditCardPromptMetric metric) { | 341 ScanCreditCardPromptMetric metric) { |
335 DCHECK_LT(metric, NUM_SCAN_CREDIT_CARD_PROMPT_METRICS); | 342 DCHECK_LT(metric, NUM_SCAN_CREDIT_CARD_PROMPT_METRICS); |
336 UMA_HISTOGRAM_ENUMERATION("Autofill.ScanCreditCardPrompt", metric, | 343 UMA_HISTOGRAM_ENUMERATION("Autofill.ScanCreditCardPrompt", metric, |
337 NUM_SCAN_CREDIT_CARD_PROMPT_METRICS); | 344 NUM_SCAN_CREDIT_CARD_PROMPT_METRICS); |
338 } | 345 } |
339 | 346 |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 DCHECK(!form_loaded_timestamp_.is_null()); | 1135 DCHECK(!form_loaded_timestamp_.is_null()); |
1129 return (base::TimeTicks::Now() - form_loaded_timestamp_).InMilliseconds(); | 1136 return (base::TimeTicks::Now() - form_loaded_timestamp_).InMilliseconds(); |
1130 } | 1137 } |
1131 | 1138 |
1132 void AutofillMetrics::FormInteractionsUkmLogger::GetNewSourceID() { | 1139 void AutofillMetrics::FormInteractionsUkmLogger::GetNewSourceID() { |
1133 source_id_ = ukm_service_->GetNewSourceID(); | 1140 source_id_ = ukm_service_->GetNewSourceID(); |
1134 ukm_service_->UpdateSourceURL(source_id_, url_); | 1141 ukm_service_->UpdateSourceURL(source_id_, url_); |
1135 } | 1142 } |
1136 | 1143 |
1137 } // namespace autofill | 1144 } // namespace autofill |
OLD | NEW |