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. | |
Ilya Sherman
2013/09/14 02:18:07
Please keep this TODO, though feel free to tweak i
guohui
2013/09/16 19:51:42
Done.
| |
611 void AutofillAgent::didAssociateFormControls( | 610 void AutofillAgent::didAssociateFormControls( |
612 const WebKit::WebVector<WebKit::WebNode>& nodes) { | 611 const WebKit::WebVector<WebKit::WebNode>& nodes) { |
612 for (size_t i = 0; i < nodes.size(); ++i) { | |
613 WebKit::WebFrame* frame = nodes[i].document().frame(); | |
614 // Only monitors dynamic forms created in the top frame. | |
Ilya Sherman
2013/09/14 02:18:07
nit: Would be nice to document *why* that's import
guohui
2013/09/16 19:51:42
Done.
| |
615 if (!frame->parent()) { | |
616 password_autofill_agent_->OnDynamicFormsSeen(frame); | |
617 return; | |
618 } | |
619 } | |
613 } | 620 } |
614 | 621 |
615 } // namespace autofill | 622 } // namespace autofill |
OLD | NEW |