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