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 AutofillMetrics::LogIsFormUserSubmitted(form.user_submitted); |
| 332 |
331 address_form_event_logger_->OnDidSubmitForm(); | 333 address_form_event_logger_->OnDidSubmitForm(); |
332 credit_card_form_event_logger_->OnDidSubmitForm(); | 334 credit_card_form_event_logger_->OnDidSubmitForm(); |
333 | 335 |
334 // Only upload server statistics and UMA metrics if at least some local data | 336 // Only upload server statistics and UMA metrics if at least some local data |
335 // is available to use as a baseline. | 337 // is available to use as a baseline. |
336 const std::vector<AutofillProfile*>& profiles = personal_data_->GetProfiles(); | 338 const std::vector<AutofillProfile*>& profiles = personal_data_->GetProfiles(); |
337 if (submitted_form->IsAutofillable()) { | 339 if (submitted_form->IsAutofillable()) { |
338 AutofillMetrics::LogNumberOfProfilesAtAutofillableFormSubmission( | 340 AutofillMetrics::LogNumberOfProfilesAtAutofillableFormSubmission( |
339 personal_data_->GetProfiles().size()); | 341 personal_data_->GetProfiles().size()); |
340 } | 342 } |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 return false; | 1463 return false; |
1462 | 1464 |
1463 // Disregard forms that we wouldn't ever autofill in the first place. | 1465 // Disregard forms that we wouldn't ever autofill in the first place. |
1464 if (!form.ShouldBeParsed()) | 1466 if (!form.ShouldBeParsed()) |
1465 return false; | 1467 return false; |
1466 | 1468 |
1467 return true; | 1469 return true; |
1468 } | 1470 } |
1469 | 1471 |
1470 } // namespace autofill | 1472 } // namespace autofill |
OLD | NEW |