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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 const PasswordFormFillData& fill_data) { | 646 const PasswordFormFillData& fill_data) { |
647 if (!IsValidFormFieldData(username_field) || | 647 if (!IsValidFormFieldData(username_field) || |
648 !IsValidPasswordFormFillData(fill_data)) | 648 !IsValidPasswordFormFillData(fill_data)) |
649 return; | 649 return; |
650 | 650 |
651 external_delegate_->AddPasswordFormMapping(username_field, fill_data); | 651 external_delegate_->AddPasswordFormMapping(username_field, fill_data); |
652 } | 652 } |
653 | 653 |
654 void AutofillManager::OnShowPasswordSuggestions( | 654 void AutofillManager::OnShowPasswordSuggestions( |
655 const FormFieldData& field, | 655 const FormFieldData& field, |
| 656 const PasswordForm& password_form, |
656 const gfx::RectF& bounds, | 657 const gfx::RectF& bounds, |
657 const std::vector<base::string16>& suggestions, | 658 const std::vector<base::string16>& suggestions, |
658 const std::vector<base::string16>& realms) { | 659 const std::vector<base::string16>& realms) { |
659 if (!IsValidString16Vector(suggestions) || | 660 if (!IsValidString16Vector(suggestions) || |
660 !IsValidString16Vector(realms) || | 661 !IsValidString16Vector(realms) || |
661 suggestions.size() != realms.size()) | 662 suggestions.size() != realms.size()) |
662 return; | 663 return; |
663 | 664 |
664 external_delegate_->OnShowPasswordSuggestions(suggestions, | 665 external_delegate_->OnShowPasswordSuggestions(suggestions, |
665 realms, | 666 realms, |
666 field, | 667 field, |
| 668 password_form, |
667 bounds); | 669 bounds); |
668 } | 670 } |
669 | 671 |
670 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, | 672 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, |
671 const std::vector<base::string16>& labels) { | 673 const std::vector<base::string16>& labels) { |
672 if (!IsValidString16Vector(values) || | 674 if (!IsValidString16Vector(values) || |
673 !IsValidString16Vector(labels) || | 675 !IsValidString16Vector(labels) || |
674 values.size() != labels.size()) | 676 values.size() != labels.size()) |
675 return; | 677 return; |
676 | 678 |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 return false; | 1159 return false; |
1158 | 1160 |
1159 // Disregard forms that we wouldn't ever autofill in the first place. | 1161 // Disregard forms that we wouldn't ever autofill in the first place. |
1160 if (!form.ShouldBeParsed(true)) | 1162 if (!form.ShouldBeParsed(true)) |
1161 return false; | 1163 return false; |
1162 | 1164 |
1163 return true; | 1165 return true; |
1164 } | 1166 } |
1165 | 1167 |
1166 } // namespace autofill | 1168 } // namespace autofill |
OLD | NEW |