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/content/renderer/password_autofill_agent.h" | 5 #include "components/autofill/content/renderer/password_autofill_agent.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 login_to_password_info_.end()) | 611 login_to_password_info_.end()) |
612 continue; | 612 continue; |
613 | 613 |
614 PasswordInfo password_info; | 614 PasswordInfo password_info; |
615 password_info.fill_data = form_data; | 615 password_info.fill_data = form_data; |
616 password_info.password_field = password_element; | 616 password_info.password_field = password_element; |
617 login_to_password_info_[username_element] = password_info; | 617 login_to_password_info_[username_element] = password_info; |
618 | 618 |
619 FormData form; | 619 FormData form; |
620 FormFieldData field; | 620 FormFieldData field; |
621 FindFormAndFieldForInputElement( | 621 FindFormAndFieldForFormControlElement( |
622 username_element, &form, &field, REQUIRE_NONE); | 622 username_element, &form, &field, REQUIRE_NONE); |
623 Send(new AutofillHostMsg_AddPasswordFormMapping( | 623 Send(new AutofillHostMsg_AddPasswordFormMapping( |
624 routing_id(), | 624 routing_id(), |
625 field, | 625 field, |
626 form_data)); | 626 form_data)); |
627 } | 627 } |
628 } | 628 } |
629 | 629 |
630 //////////////////////////////////////////////////////////////////////////////// | 630 //////////////////////////////////////////////////////////////////////////////// |
631 // PasswordAutofillAgent, private: | 631 // PasswordAutofillAgent, private: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 if (!webview) | 673 if (!webview) |
674 return false; | 674 return false; |
675 | 675 |
676 std::vector<base::string16> suggestions; | 676 std::vector<base::string16> suggestions; |
677 std::vector<base::string16> realms; | 677 std::vector<base::string16> realms; |
678 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); | 678 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); |
679 DCHECK_EQ(suggestions.size(), realms.size()); | 679 DCHECK_EQ(suggestions.size(), realms.size()); |
680 | 680 |
681 FormData form; | 681 FormData form; |
682 FormFieldData field; | 682 FormFieldData field; |
683 FindFormAndFieldForInputElement( | 683 FindFormAndFieldForFormControlElement( |
684 user_input, &form, &field, REQUIRE_NONE); | 684 user_input, &form, &field, REQUIRE_NONE); |
685 | 685 |
686 blink::WebInputElement selected_element = user_input; | 686 blink::WebInputElement selected_element = user_input; |
687 gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); | 687 gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); |
688 | 688 |
689 float scale = web_view_->pageScaleFactor(); | 689 float scale = web_view_->pageScaleFactor(); |
690 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, | 690 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, |
691 bounding_box.y() * scale, | 691 bounding_box.y() * scale, |
692 bounding_box.width() * scale, | 692 bounding_box.width() * scale, |
693 bounding_box.height() * scale); | 693 bounding_box.height() * scale); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); | 880 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); |
881 if (iter == login_to_password_info_.end()) | 881 if (iter == login_to_password_info_.end()) |
882 return false; | 882 return false; |
883 | 883 |
884 *found_input = input; | 884 *found_input = input; |
885 *found_password = iter->second; | 885 *found_password = iter->second; |
886 return true; | 886 return true; |
887 } | 887 } |
888 | 888 |
889 } // namespace autofill | 889 } // namespace autofill |
OLD | NEW |