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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 700 |
701 void AutofillManager::ImportFormData(const FormStructure& submitted_form) { | 701 void AutofillManager::ImportFormData(const FormStructure& submitted_form) { |
702 scoped_ptr<CreditCard> imported_credit_card; | 702 scoped_ptr<CreditCard> imported_credit_card; |
703 if (!personal_data_->ImportFormData(submitted_form, &imported_credit_card)) | 703 if (!personal_data_->ImportFormData(submitted_form, &imported_credit_card)) |
704 return; | 704 return; |
705 | 705 |
706 // If credit card information was submitted, we need to confirm whether to | 706 // If credit card information was submitted, we need to confirm whether to |
707 // save it. | 707 // save it. |
708 if (imported_credit_card) { | 708 if (imported_credit_card) { |
709 client_->ConfirmSaveCreditCard( | 709 client_->ConfirmSaveCreditCard( |
710 *metric_logger_, | 710 this, *metric_logger_, |
711 base::Bind( | 711 base::Bind( |
712 base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard), | 712 base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard), |
713 base::Unretained(personal_data_), | 713 base::Unretained(personal_data_), *imported_credit_card)); |
714 *imported_credit_card)); | |
715 } | 714 } |
716 } | 715 } |
717 | 716 |
718 // Note that |submitted_form| is passed as a pointer rather than as a reference | 717 // Note that |submitted_form| is passed as a pointer rather than as a reference |
719 // so that we can get memory management right across threads. Note also that we | 718 // so that we can get memory management right across threads. Note also that we |
720 // explicitly pass in all the time stamps of interest, as the cached ones might | 719 // explicitly pass in all the time stamps of interest, as the cached ones might |
721 // get reset before this method executes. | 720 // get reset before this method executes. |
722 void AutofillManager::UploadFormDataAsyncCallback( | 721 void AutofillManager::UploadFormDataAsyncCallback( |
723 const FormStructure* submitted_form, | 722 const FormStructure* submitted_form, |
724 const TimeTicks& load_time, | 723 const TimeTicks& load_time, |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 return false; | 1294 return false; |
1296 | 1295 |
1297 // Disregard forms that we wouldn't ever autofill in the first place. | 1296 // Disregard forms that we wouldn't ever autofill in the first place. |
1298 if (!form.ShouldBeParsed()) | 1297 if (!form.ShouldBeParsed()) |
1299 return false; | 1298 return false; |
1300 | 1299 |
1301 return true; | 1300 return true; |
1302 } | 1301 } |
1303 | 1302 |
1304 } // namespace autofill | 1303 } // namespace autofill |
OLD | NEW |