| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 const std::vector<FormStructure*>& AutofillManager::GetFormStructures() { | 634 const std::vector<FormStructure*>& AutofillManager::GetFormStructures() { |
| 635 return form_structures_.get(); | 635 return form_structures_.get(); |
| 636 } | 636 } |
| 637 | 637 |
| 638 void AutofillManager::SetTestDelegate( | 638 void AutofillManager::SetTestDelegate( |
| 639 autofill::AutofillManagerTestDelegate* delegate) { | 639 autofill::AutofillManagerTestDelegate* delegate) { |
| 640 test_delegate_ = delegate; | 640 test_delegate_ = delegate; |
| 641 } | 641 } |
| 642 | 642 |
| 643 void AutofillManager::OnAddPasswordFormMapping( | |
| 644 const FormFieldData& username_field, | |
| 645 const PasswordFormFillData& fill_data) { | |
| 646 if (!IsValidFormFieldData(username_field) || | |
| 647 !IsValidPasswordFormFillData(fill_data)) | |
| 648 return; | |
| 649 | |
| 650 external_delegate_->AddPasswordFormMapping(username_field, fill_data); | |
| 651 } | |
| 652 | |
| 653 void AutofillManager::OnShowPasswordSuggestions( | |
| 654 const FormFieldData& field, | |
| 655 const gfx::RectF& bounds, | |
| 656 const std::vector<base::string16>& suggestions, | |
| 657 const std::vector<base::string16>& realms) { | |
| 658 if (!IsValidString16Vector(suggestions) || | |
| 659 !IsValidString16Vector(realms) || | |
| 660 suggestions.size() != realms.size()) | |
| 661 return; | |
| 662 | |
| 663 external_delegate_->OnShowPasswordSuggestions(suggestions, | |
| 664 realms, | |
| 665 field, | |
| 666 bounds); | |
| 667 } | |
| 668 | |
| 669 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, | 643 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, |
| 670 const std::vector<base::string16>& labels) { | 644 const std::vector<base::string16>& labels) { |
| 671 if (!IsValidString16Vector(values) || | 645 if (!IsValidString16Vector(values) || |
| 672 !IsValidString16Vector(labels) || | 646 !IsValidString16Vector(labels) || |
| 673 values.size() != labels.size()) | 647 values.size() != labels.size()) |
| 674 return; | 648 return; |
| 675 | 649 |
| 676 external_delegate_->SetCurrentDataListValues(values, labels); | 650 external_delegate_->SetCurrentDataListValues(values, labels); |
| 677 } | 651 } |
| 678 | 652 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 return false; | 1130 return false; |
| 1157 | 1131 |
| 1158 // Disregard forms that we wouldn't ever autofill in the first place. | 1132 // Disregard forms that we wouldn't ever autofill in the first place. |
| 1159 if (!form.ShouldBeParsed(true)) | 1133 if (!form.ShouldBeParsed(true)) |
| 1160 return false; | 1134 return false; |
| 1161 | 1135 |
| 1162 return true; | 1136 return true; |
| 1163 } | 1137 } |
| 1164 | 1138 |
| 1165 } // namespace autofill | 1139 } // namespace autofill |
| OLD | NEW |