| 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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 | 791 |
| 792 void AutofillManager::ImportFormData(const FormStructure& submitted_form) { | 792 void AutofillManager::ImportFormData(const FormStructure& submitted_form) { |
| 793 scoped_ptr<CreditCard> imported_credit_card; | 793 scoped_ptr<CreditCard> imported_credit_card; |
| 794 if (!personal_data_->ImportFormData(submitted_form, &imported_credit_card)) | 794 if (!personal_data_->ImportFormData(submitted_form, &imported_credit_card)) |
| 795 return; | 795 return; |
| 796 | 796 |
| 797 // If credit card information was submitted, we need to confirm whether to | 797 // If credit card information was submitted, we need to confirm whether to |
| 798 // save it. | 798 // save it. |
| 799 if (imported_credit_card) { | 799 if (imported_credit_card) { |
| 800 client_->ConfirmSaveCreditCard( | 800 client_->ConfirmSaveCreditCard( |
| 801 *metric_logger_, | 801 *driver_, *metric_logger_, |
| 802 base::Bind( | 802 base::Bind( |
| 803 base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard), | 803 base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard), |
| 804 base::Unretained(personal_data_), | 804 base::Unretained(personal_data_), *imported_credit_card)); |
| 805 *imported_credit_card)); | |
| 806 } | 805 } |
| 807 } | 806 } |
| 808 | 807 |
| 809 // Note that |submitted_form| is passed as a pointer rather than as a reference | 808 // Note that |submitted_form| is passed as a pointer rather than as a reference |
| 810 // so that we can get memory management right across threads. Note also that we | 809 // so that we can get memory management right across threads. Note also that we |
| 811 // explicitly pass in all the time stamps of interest, as the cached ones might | 810 // explicitly pass in all the time stamps of interest, as the cached ones might |
| 812 // get reset before this method executes. | 811 // get reset before this method executes. |
| 813 void AutofillManager::UploadFormDataAsyncCallback( | 812 void AutofillManager::UploadFormDataAsyncCallback( |
| 814 const FormStructure* submitted_form, | 813 const FormStructure* submitted_form, |
| 815 const TimeTicks& load_time, | 814 const TimeTicks& load_time, |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 return false; | 1245 return false; |
| 1247 | 1246 |
| 1248 // Disregard forms that we wouldn't ever autofill in the first place. | 1247 // Disregard forms that we wouldn't ever autofill in the first place. |
| 1249 if (!form.ShouldBeParsed()) | 1248 if (!form.ShouldBeParsed()) |
| 1250 return false; | 1249 return false; |
| 1251 | 1250 |
| 1252 return true; | 1251 return true; |
| 1253 } | 1252 } |
| 1254 | 1253 |
| 1255 } // namespace autofill | 1254 } // namespace autofill |
| OLD | NEW |