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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 login_to_password_info_.end()) | 578 login_to_password_info_.end()) |
579 continue; | 579 continue; |
580 | 580 |
581 PasswordInfo password_info; | 581 PasswordInfo password_info; |
582 password_info.fill_data = form_data; | 582 password_info.fill_data = form_data; |
583 password_info.password_field = password_element; | 583 password_info.password_field = password_element; |
584 login_to_password_info_[username_element] = password_info; | 584 login_to_password_info_[username_element] = password_info; |
585 | 585 |
586 FormData form; | 586 FormData form; |
587 FormFieldData field; | 587 FormFieldData field; |
588 FindFormAndFieldForInputElement( | 588 FindFormAndFieldForFormControlElement( |
589 username_element, &form, &field, REQUIRE_NONE); | 589 username_element, &form, &field, REQUIRE_NONE); |
590 Send(new AutofillHostMsg_AddPasswordFormMapping( | 590 Send(new AutofillHostMsg_AddPasswordFormMapping( |
591 routing_id(), | 591 routing_id(), |
592 field, | 592 field, |
593 form_data)); | 593 form_data)); |
594 } | 594 } |
595 } | 595 } |
596 | 596 |
597 //////////////////////////////////////////////////////////////////////////////// | 597 //////////////////////////////////////////////////////////////////////////////// |
598 // PasswordAutofillAgent, private: | 598 // PasswordAutofillAgent, private: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 if (!webview) | 640 if (!webview) |
641 return false; | 641 return false; |
642 | 642 |
643 std::vector<base::string16> suggestions; | 643 std::vector<base::string16> suggestions; |
644 std::vector<base::string16> realms; | 644 std::vector<base::string16> realms; |
645 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); | 645 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); |
646 DCHECK_EQ(suggestions.size(), realms.size()); | 646 DCHECK_EQ(suggestions.size(), realms.size()); |
647 | 647 |
648 FormData form; | 648 FormData form; |
649 FormFieldData field; | 649 FormFieldData field; |
650 FindFormAndFieldForInputElement( | 650 FindFormAndFieldForFormControlElement( |
651 user_input, &form, &field, REQUIRE_NONE); | 651 user_input, &form, &field, REQUIRE_NONE); |
652 | 652 |
653 blink::WebInputElement selected_element = user_input; | 653 blink::WebInputElement selected_element = user_input; |
654 gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); | 654 gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); |
655 | 655 |
656 float scale = web_view_->pageScaleFactor(); | 656 float scale = web_view_->pageScaleFactor(); |
657 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, | 657 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, |
658 bounding_box.y() * scale, | 658 bounding_box.y() * scale, |
659 bounding_box.width() * scale, | 659 bounding_box.width() * scale, |
660 bounding_box.height() * scale); | 660 bounding_box.height() * scale); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 } | 870 } |
871 | 871 |
872 PasswordAutofillAgent::AutofillWebUserGestureHandler:: | 872 PasswordAutofillAgent::AutofillWebUserGestureHandler:: |
873 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent) | 873 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent) |
874 : agent_(agent) {} | 874 : agent_(agent) {} |
875 | 875 |
876 PasswordAutofillAgent::AutofillWebUserGestureHandler:: | 876 PasswordAutofillAgent::AutofillWebUserGestureHandler:: |
877 ~AutofillWebUserGestureHandler() {} | 877 ~AutofillWebUserGestureHandler() {} |
878 | 878 |
879 } // namespace autofill | 879 } // namespace autofill |
OLD | NEW |