| 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 login_to_password_info_.end()) | 630 login_to_password_info_.end()) |
| 631 continue; | 631 continue; |
| 632 | 632 |
| 633 PasswordInfo password_info; | 633 PasswordInfo password_info; |
| 634 password_info.fill_data = form_data; | 634 password_info.fill_data = form_data; |
| 635 password_info.password_field = password_element; | 635 password_info.password_field = password_element; |
| 636 login_to_password_info_[username_element] = password_info; | 636 login_to_password_info_[username_element] = password_info; |
| 637 | 637 |
| 638 FormData form; | 638 FormData form; |
| 639 FormFieldData field; | 639 FormFieldData field; |
| 640 FindFormAndFieldForInputElement( | 640 FindFormAndFieldForFormControlElement( |
| 641 username_element, &form, &field, REQUIRE_NONE); | 641 username_element, &form, &field, REQUIRE_NONE); |
| 642 Send(new AutofillHostMsg_AddPasswordFormMapping( | 642 Send(new AutofillHostMsg_AddPasswordFormMapping( |
| 643 routing_id(), | 643 routing_id(), |
| 644 field, | 644 field, |
| 645 form_data)); | 645 form_data)); |
| 646 } | 646 } |
| 647 } | 647 } |
| 648 | 648 |
| 649 //////////////////////////////////////////////////////////////////////////////// | 649 //////////////////////////////////////////////////////////////////////////////// |
| 650 // PasswordAutofillAgent, private: | 650 // PasswordAutofillAgent, private: |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 if (!webview) | 692 if (!webview) |
| 693 return false; | 693 return false; |
| 694 | 694 |
| 695 std::vector<base::string16> suggestions; | 695 std::vector<base::string16> suggestions; |
| 696 std::vector<base::string16> realms; | 696 std::vector<base::string16> realms; |
| 697 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); | 697 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); |
| 698 DCHECK_EQ(suggestions.size(), realms.size()); | 698 DCHECK_EQ(suggestions.size(), realms.size()); |
| 699 | 699 |
| 700 FormData form; | 700 FormData form; |
| 701 FormFieldData field; | 701 FormFieldData field; |
| 702 FindFormAndFieldForInputElement( | 702 FindFormAndFieldForFormControlElement( |
| 703 user_input, &form, &field, REQUIRE_NONE); | 703 user_input, &form, &field, REQUIRE_NONE); |
| 704 | 704 |
| 705 blink::WebInputElement selected_element = user_input; | 705 blink::WebInputElement selected_element = user_input; |
| 706 gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); | 706 gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); |
| 707 | 707 |
| 708 float scale = web_view_->pageScaleFactor(); | 708 float scale = web_view_->pageScaleFactor(); |
| 709 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, | 709 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, |
| 710 bounding_box.y() * scale, | 710 bounding_box.y() * scale, |
| 711 bounding_box.width() * scale, | 711 bounding_box.width() * scale, |
| 712 bounding_box.height() * scale); | 712 bounding_box.height() * scale); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); | 905 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); |
| 906 if (iter == login_to_password_info_.end()) | 906 if (iter == login_to_password_info_.end()) |
| 907 return false; | 907 return false; |
| 908 | 908 |
| 909 *found_input = input; | 909 *found_input = input; |
| 910 *found_password = iter->second; | 910 *found_password = iter->second; |
| 911 return true; | 911 return true; |
| 912 } | 912 } |
| 913 | 913 |
| 914 } // namespace autofill | 914 } // namespace autofill |
| OLD | NEW |