| 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/autofill_agent.h" | 5 #include "components/autofill/content/renderer/autofill_agent.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 node->setSelectionRange(node->value().length(), | 730 node->setSelectionRange(node->value().length(), |
| 731 node->suggestedValue().length()); | 731 node->suggestedValue().length()); |
| 732 } | 732 } |
| 733 | 733 |
| 734 void AutofillAgent::ProcessForms() { | 734 void AutofillAgent::ProcessForms() { |
| 735 // Record timestamp of when the forms are first seen. This is used to | 735 // Record timestamp of when the forms are first seen. This is used to |
| 736 // measure the overhead of the Autofill feature. | 736 // measure the overhead of the Autofill feature. |
| 737 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now(); | 737 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now(); |
| 738 | 738 |
| 739 WebLocalFrame* frame = render_frame()->GetWebFrame(); | 739 WebLocalFrame* frame = render_frame()->GetWebFrame(); |
| 740 std::vector<FormData> forms = form_cache_.ExtractNewForms(); | 740 size_t unowned_form_index; |
| 741 std::vector<FormData> forms = |
| 742 form_cache_.ExtractNewForms(&unowned_form_index); |
| 741 | 743 |
| 742 // Always communicate to browser process for topmost frame. | 744 // Always communicate to browser process for topmost frame. |
| 743 if (!forms.empty() || !frame->parent()) { | 745 if (!forms.empty() || !frame->parent()) { |
| 744 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, | 746 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, unowned_form_index, |
| 745 forms_seen_timestamp)); | 747 forms_seen_timestamp)); |
| 746 } | 748 } |
| 747 } | 749 } |
| 748 | 750 |
| 749 void AutofillAgent::HidePopup() { | 751 void AutofillAgent::HidePopup() { |
| 750 if (!is_popup_possibly_visible_) | 752 if (!is_popup_possibly_visible_) |
| 751 return; | 753 return; |
| 752 is_popup_possibly_visible_ = false; | 754 is_popup_possibly_visible_ = false; |
| 753 Send(new AutofillHostMsg_HidePopup(routing_id())); | 755 Send(new AutofillHostMsg_HidePopup(routing_id())); |
| 754 } | 756 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged( | 790 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged( |
| 789 const WebNode& node) { | 791 const WebNode& node) { |
| 790 agent_->FocusedNodeChanged(node); | 792 agent_->FocusedNodeChanged(node); |
| 791 } | 793 } |
| 792 | 794 |
| 793 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { | 795 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { |
| 794 agent_->FocusChangeComplete(); | 796 agent_->FocusChangeComplete(); |
| 795 } | 797 } |
| 796 | 798 |
| 797 } // namespace autofill | 799 } // namespace autofill |
| OLD | NEW |