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

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

Issue 662493002: [Password Generation] Enable generation for dynamically created forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android Created 6 years, 2 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 (*strings)[i].resize(kMaxDataLength); 116 (*strings)[i].resize(kMaxDataLength);
117 } 117 }
118 } 118 }
119 119
120 } // namespace 120 } // namespace
121 121
122 AutofillAgent::AutofillAgent(content::RenderView* render_view, 122 AutofillAgent::AutofillAgent(content::RenderView* render_view,
123 PasswordAutofillAgent* password_autofill_agent, 123 PasswordAutofillAgent* password_autofill_agent,
124 PasswordGenerationAgent* password_generation_agent) 124 PasswordGenerationAgent* password_generation_agent)
125 : content::RenderViewObserver(render_view), 125 : content::RenderViewObserver(render_view),
126 password_autofill_agent_(password_autofill_agent), 126 password_autofill_agent_(password_autofill_agent),
boliu 2014/10/20 23:24:31 This seems unsafe as to have two RVObservers have
Garrett Casto 2014/10/20 23:40:59 Well, access and deletion of these objects always
boliu 2014/10/20 23:45:09 The issue is accessing the raw pointer in Autofill
127 password_generation_agent_(password_generation_agent), 127 password_generation_agent_(password_generation_agent),
128 autofill_query_id_(0), 128 autofill_query_id_(0),
129 web_view_(render_view->GetWebView()), 129 web_view_(render_view->GetWebView()),
130 display_warning_if_disabled_(false), 130 display_warning_if_disabled_(false),
131 was_query_node_autofilled_(false), 131 was_query_node_autofilled_(false),
132 has_shown_autofill_popup_for_current_edit_(false), 132 has_shown_autofill_popup_for_current_edit_(false),
133 did_set_node_text_(false), 133 did_set_node_text_(false),
134 ignore_text_changes_(false), 134 ignore_text_changes_(false),
135 is_popup_possibly_visible_(false), 135 is_popup_possibly_visible_(false),
136 main_frame_processed_(false), 136 main_frame_processed_(false),
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 void AutofillAgent::didAssociateFormControls(const WebVector<WebNode>& nodes) { 723 void AutofillAgent::didAssociateFormControls(const WebVector<WebNode>& nodes) {
724 for (size_t i = 0; i < nodes.size(); ++i) { 724 for (size_t i = 0; i < nodes.size(); ++i) {
725 WebLocalFrame* frame = nodes[i].document().frame(); 725 WebLocalFrame* frame = nodes[i].document().frame();
726 // Only monitors dynamic forms created in the top frame. Dynamic forms 726 // Only monitors dynamic forms created in the top frame. Dynamic forms
727 // inserted in iframes are not captured yet. Frame is only processed 727 // inserted in iframes are not captured yet. Frame is only processed
728 // if it has finished loading, otherwise you can end up with a partially 728 // if it has finished loading, otherwise you can end up with a partially
729 // parsed form. 729 // parsed form.
730 if (frame && !frame->parent() && !frame->isLoading()) { 730 if (frame && !frame->parent() && !frame->isLoading()) {
731 ProcessForms(*frame); 731 ProcessForms(*frame);
732 password_autofill_agent_->OnDynamicFormsSeen(frame); 732 password_autofill_agent_->OnDynamicFormsSeen(frame);
733 password_generation_agent_->OnDynamicFormsSeen(frame);
733 return; 734 return;
734 } 735 }
735 } 736 }
736 } 737 }
737 738
738 } // namespace autofill 739 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698