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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 // to fill. | 262 // to fill. |
263 FORM_EVENT_SERVER_SUGGESTION_FILLED, | 263 FORM_EVENT_SERVER_SUGGESTION_FILLED, |
264 // A masked server card suggestion was used to fill the form. | 264 // A masked server card suggestion was used to fill the form. |
265 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, | 265 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, |
266 // A suggestion was used to fill the form. The origin type (local or server | 266 // A suggestion was used to fill the form. The origin type (local or server |
267 // or masked server card) of the first selected within a page load will | 267 // or masked server card) of the first selected within a page load will |
268 // determine which of the following two will be fired. | 268 // determine which of the following two will be fired. |
269 FORM_EVENT_LOCAL_SUGGESTION_FILLED_ONCE, | 269 FORM_EVENT_LOCAL_SUGGESTION_FILLED_ONCE, |
270 FORM_EVENT_SERVER_SUGGESTION_FILLED_ONCE, | 270 FORM_EVENT_SERVER_SUGGESTION_FILLED_ONCE, |
271 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED_ONCE, | 271 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED_ONCE, |
272 // An autofillable form is about to be submitted. If the submission is not | |
273 // interrupted by JavaScript, the "form submitted" events below will also be | |
274 // logged. | |
275 FORM_EVENT_WILL_SUBMIT, | |
Ilya Sherman
2015/03/18 22:42:10
Why are you adding this event in the middle of the
Mathieu
2015/03/23 15:24:02
Done. Yes of course.
| |
272 // A form was submitted. Depending on the user filling a local, server, | 276 // A form was submitted. Depending on the user filling a local, server, |
273 // masked server card or no suggestion one of the following will be | 277 // masked server card or no suggestion one of the following will be |
274 // triggered. Only one of the following four will be triggered per page | 278 // triggered. Only one of the following four will be triggered per page |
275 // load. | 279 // load. |
276 FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, | 280 FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, |
277 FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, | 281 FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, |
278 FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, | 282 FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, |
279 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, | 283 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, |
280 // A masked server card suggestion was selected to fill the form. | 284 // A masked server card suggestion was selected to fill the form. |
281 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED, | 285 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED, |
282 // Same as above but only triggered once per page load. | 286 // Same as above but only triggered once per page load. |
283 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED_ONCE, | 287 FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SELECTED_ONCE, |
288 | |
284 NUM_FORM_EVENTS, | 289 NUM_FORM_EVENTS, |
285 }; | 290 }; |
286 | 291 |
287 // For measuring the network request time of various Wallet API calls. See | 292 // For measuring the network request time of various Wallet API calls. See |
288 // WalletClient::RequestType. | 293 // WalletClient::RequestType. |
289 enum WalletApiCallMetric { | 294 enum WalletApiCallMetric { |
290 UNKNOWN_API_CALL, // Catch all. Should never be used. | 295 UNKNOWN_API_CALL, // Catch all. Should never be used. |
291 ACCEPT_LEGAL_DOCUMENTS, | 296 ACCEPT_LEGAL_DOCUMENTS, |
292 AUTHENTICATE_INSTRUMENT, | 297 AUTHENTICATE_INSTRUMENT, |
293 GET_FULL_WALLET, | 298 GET_FULL_WALLET, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
487 void OnDidShowSuggestions(); | 492 void OnDidShowSuggestions(); |
488 | 493 |
489 void OnDidSelectMaskedServerCardSuggestion(); | 494 void OnDidSelectMaskedServerCardSuggestion(); |
490 | 495 |
491 // In case of masked cards, caller must make sure this gets called before | 496 // In case of masked cards, caller must make sure this gets called before |
492 // the card is upgraded to a full card. | 497 // the card is upgraded to a full card. |
493 void OnDidFillSuggestion(const CreditCard& credit_card); | 498 void OnDidFillSuggestion(const CreditCard& credit_card); |
494 | 499 |
495 void OnDidFillSuggestion(const AutofillProfile& profile); | 500 void OnDidFillSuggestion(const AutofillProfile& profile); |
496 | 501 |
502 void OnWillSubmitForm(); | |
503 | |
497 void OnDidSubmitForm(); | 504 void OnDidSubmitForm(); |
498 | 505 |
499 private: | 506 private: |
500 void Log(FormEvent event) const; | 507 void Log(FormEvent event) const; |
501 | 508 |
502 bool is_for_credit_card_; | 509 bool is_for_credit_card_; |
503 bool is_server_data_available_; | 510 bool is_server_data_available_; |
504 bool is_local_data_available_; | 511 bool is_local_data_available_; |
505 bool has_logged_interacted_; | 512 bool has_logged_interacted_; |
506 bool has_logged_suggestions_shown_; | 513 bool has_logged_suggestions_shown_; |
507 bool has_logged_masked_server_card_suggestion_selected_; | 514 bool has_logged_masked_server_card_suggestion_selected_; |
508 bool has_logged_suggestion_filled_; | 515 bool has_logged_suggestion_filled_; |
509 bool has_logged_submitted_; | 516 bool has_logged_submitted_; |
510 bool logged_suggestion_filled_was_server_data_; | 517 bool logged_suggestion_filled_was_server_data_; |
511 bool logged_suggestion_filled_was_masked_server_card_; | 518 bool logged_suggestion_filled_was_masked_server_card_; |
512 }; | 519 }; |
513 | 520 |
514 private: | 521 private: |
515 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 522 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
516 }; | 523 }; |
517 | 524 |
518 } // namespace autofill | 525 } // namespace autofill |
519 | 526 |
520 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 527 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
OLD | NEW |