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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 base::string16 substring = value; | 600 base::string16 substring = value; |
601 substring = substring.substr(0, node->maxLength()); | 601 substring = substring.substr(0, node->maxLength()); |
602 | 602 |
603 node->setEditingValue(substring); | 603 node->setEditingValue(substring); |
604 } | 604 } |
605 | 605 |
606 void AutofillAgent::HideAutofillUI() { | 606 void AutofillAgent::HideAutofillUI() { |
607 Send(new AutofillHostMsg_HideAutofillUI(routing_id())); | 607 Send(new AutofillHostMsg_HideAutofillUI(routing_id())); |
608 } | 608 } |
609 | 609 |
610 // TODO(isherman): Decide if we want to support autofill with AJAX. | 610 // TODO(isherman): Decide if we want to support non-password autofill with AJAX. |
611 void AutofillAgent::didAssociateFormControls( | 611 void AutofillAgent::didAssociateFormControls( |
612 const WebKit::WebVector<WebKit::WebNode>& nodes) { | 612 const WebKit::WebVector<WebKit::WebNode>& nodes) { |
| 613 for (size_t i = 0; i < nodes.size(); ++i) { |
| 614 WebKit::WebFrame* frame = nodes[i].document().frame(); |
| 615 // Only monitors dynamic forms created in the top frame. Dynamic forms |
| 616 // inserted in iframes are not captured yet. |
| 617 if (!frame->parent()) { |
| 618 password_autofill_agent_->OnDynamicFormsSeen(frame); |
| 619 return; |
| 620 } |
| 621 } |
613 } | 622 } |
614 | 623 |
615 } // namespace autofill | 624 } // namespace autofill |
OLD | NEW |