Chromium Code Reviews| 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_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 | 321 |
| 322 bool AutofillManager::OnWillSubmitForm(const FormData& form, | 322 bool AutofillManager::OnWillSubmitForm(const FormData& form, |
| 323 const TimeTicks& timestamp) { | 323 const TimeTicks& timestamp) { |
| 324 if (!IsValidFormData(form)) | 324 if (!IsValidFormData(form)) |
| 325 return false; | 325 return false; |
| 326 | 326 |
| 327 scoped_ptr<FormStructure> submitted_form = ValidateSubmittedForm(form); | 327 scoped_ptr<FormStructure> submitted_form = ValidateSubmittedForm(form); |
| 328 if (!submitted_form) | 328 if (!submitted_form) |
| 329 return false; | 329 return false; |
| 330 | 330 |
| 331 address_form_event_logger_->OnDidSubmitForm(); | 331 address_form_event_logger_->OnWillSubmitForm(); |
| 332 credit_card_form_event_logger_->OnDidSubmitForm(); | 332 credit_card_form_event_logger_->OnWillSubmitForm(); |
| 333 | 333 |
| 334 // Only upload server statistics and UMA metrics if at least some local data | 334 // Only upload server statistics and UMA metrics if at least some local data |
| 335 // is available to use as a baseline. | 335 // is available to use as a baseline. |
| 336 const std::vector<AutofillProfile*>& profiles = personal_data_->GetProfiles(); | 336 const std::vector<AutofillProfile*>& profiles = personal_data_->GetProfiles(); |
| 337 if (submitted_form->IsAutofillable()) { | 337 if (submitted_form->IsAutofillable()) { |
| 338 AutofillMetrics::LogNumberOfProfilesAtAutofillableFormSubmission( | 338 AutofillMetrics::LogNumberOfProfilesAtAutofillableFormSubmission( |
| 339 personal_data_->GetProfiles().size()); | 339 personal_data_->GetProfiles().size()); |
| 340 } | 340 } |
| 341 const std::vector<CreditCard*>& credit_cards = | 341 const std::vector<CreditCard*>& credit_cards = |
| 342 personal_data_->GetCreditCards(); | 342 personal_data_->GetCreditCards(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 if (!IsValidFormData(form)) | 382 if (!IsValidFormData(form)) |
| 383 return false; | 383 return false; |
| 384 | 384 |
| 385 // Let Autocomplete know as well. | 385 // Let Autocomplete know as well. |
| 386 autocomplete_history_manager_->OnFormSubmitted(form); | 386 autocomplete_history_manager_->OnFormSubmitted(form); |
| 387 | 387 |
| 388 scoped_ptr<FormStructure> submitted_form = ValidateSubmittedForm(form); | 388 scoped_ptr<FormStructure> submitted_form = ValidateSubmittedForm(form); |
| 389 if (!submitted_form) | 389 if (!submitted_form) |
| 390 return false; | 390 return false; |
| 391 | 391 |
| 392 address_form_event_logger_->OnDidSubmitForm(); | |
| 393 credit_card_form_event_logger_->OnDidSubmitForm(); | |
|
Evan Stade
2015/03/20 20:55:03
can we keep the names the same? i.e. OnFormSubmitt
Mathieu
2015/03/23 15:24:02
Sure, renamed OnDidSubmitForm to OnFormSubmitted.
| |
| 394 | |
| 392 // Update Personal Data with the form's submitted data. | 395 // Update Personal Data with the form's submitted data. |
| 393 if (submitted_form->IsAutofillable()) | 396 if (submitted_form->IsAutofillable()) |
| 394 ImportFormData(*submitted_form); | 397 ImportFormData(*submitted_form); |
| 395 | 398 |
| 396 return true; | 399 return true; |
| 397 } | 400 } |
| 398 | 401 |
| 399 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, | 402 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, |
| 400 const TimeTicks& timestamp) { | 403 const TimeTicks& timestamp) { |
| 401 if (!IsValidFormDataVector(forms)) | 404 if (!IsValidFormDataVector(forms)) |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1462 return false; | 1465 return false; |
| 1463 | 1466 |
| 1464 // Disregard forms that we wouldn't ever autofill in the first place. | 1467 // Disregard forms that we wouldn't ever autofill in the first place. |
| 1465 if (!form.ShouldBeParsed()) | 1468 if (!form.ShouldBeParsed()) |
| 1466 return false; | 1469 return false; |
| 1467 | 1470 |
| 1468 return true; | 1471 return true; |
| 1469 } | 1472 } |
| 1470 | 1473 |
| 1471 } // namespace autofill | 1474 } // namespace autofill |
| OLD | NEW |