Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 853523004: Autofill: Set requirements for number of recognized fields in an autofillable form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 node->setSelectionRange(node->value().length(), 721 node->setSelectionRange(node->value().length(),
722 node->suggestedValue().length()); 722 node->suggestedValue().length());
723 } 723 }
724 724
725 void AutofillAgent::ProcessForms() { 725 void AutofillAgent::ProcessForms() {
726 // Record timestamp of when the forms are first seen. This is used to 726 // Record timestamp of when the forms are first seen. This is used to
727 // measure the overhead of the Autofill feature. 727 // measure the overhead of the Autofill feature.
728 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now(); 728 base::TimeTicks forms_seen_timestamp = base::TimeTicks::Now();
729 729
730 WebLocalFrame* frame = render_frame()->GetWebFrame(); 730 WebLocalFrame* frame = render_frame()->GetWebFrame();
731 std::vector<FormData> forms = form_cache_.ExtractNewForms(); 731 size_t unowned_form_index;
732 std::vector<FormData> forms =
733 form_cache_.ExtractNewForms(&unowned_form_index);
732 734
733 // Always communicate to browser process for topmost frame. 735 // Always communicate to browser process for topmost frame.
734 if (!forms.empty() || !frame->parent()) { 736 if (!forms.empty() || !frame->parent()) {
735 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, 737 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, unowned_form_index,
736 forms_seen_timestamp)); 738 forms_seen_timestamp));
737 } 739 }
738 } 740 }
739 741
740 void AutofillAgent::HidePopup() { 742 void AutofillAgent::HidePopup() {
741 if (!is_popup_possibly_visible_) 743 if (!is_popup_possibly_visible_)
742 return; 744 return;
743 745
744 if (!element_.isNull()) 746 if (!element_.isNull())
745 OnClearPreviewedForm(); 747 OnClearPreviewedForm();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged( 785 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged(
784 const WebNode& node) { 786 const WebNode& node) {
785 agent_->FocusedNodeChanged(node); 787 agent_->FocusedNodeChanged(node);
786 } 788 }
787 789
788 void AutofillAgent::LegacyAutofillAgent::Resized() { 790 void AutofillAgent::LegacyAutofillAgent::Resized() {
789 agent_->Resized(); 791 agent_->Resized();
790 } 792 }
791 793
792 } // namespace autofill 794 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698