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/password_generation_agent.h" | 5 #include "components/autofill/content/renderer/password_generation_agent.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 if (last_focused_password_element_.IsNull() || !render_frame()) | 584 if (last_focused_password_element_.IsNull() || !render_frame()) |
585 return; | 585 return; |
586 | 586 |
587 blink::WebFormElement form = last_focused_password_element_.Form(); | 587 blink::WebFormElement form = last_focused_password_element_.Form(); |
588 std::unique_ptr<PasswordForm> password_form; | 588 std::unique_ptr<PasswordForm> password_form; |
589 std::vector<blink::WebFormControlElement> control_elements; | 589 std::vector<blink::WebFormControlElement> control_elements; |
590 if (!form.IsNull()) { | 590 if (!form.IsNull()) { |
591 password_form = CreatePasswordFormFromWebForm(form, nullptr, nullptr); | 591 password_form = CreatePasswordFormFromWebForm(form, nullptr, nullptr); |
592 control_elements = form_util::ExtractAutofillableElementsInForm(form); | 592 control_elements = form_util::ExtractAutofillableElementsInForm(form); |
593 } else { | 593 } else { |
594 const blink::WebFrame& frame = *render_frame()->GetWebFrame(); | 594 const blink::WebLocalFrame& frame = *render_frame()->GetWebFrame(); |
595 blink::WebDocument doc = frame.GetDocument(); | 595 blink::WebDocument doc = frame.GetDocument(); |
596 if (doc.IsNull()) | 596 if (doc.IsNull()) |
597 return; | 597 return; |
598 password_form = | 598 password_form = |
599 CreatePasswordFormFromUnownedInputElements(frame, nullptr, nullptr); | 599 CreatePasswordFormFromUnownedInputElements(frame, nullptr, nullptr); |
600 control_elements = | 600 control_elements = |
601 form_util::GetUnownedFormFieldElements(doc.All(), nullptr); | 601 form_util::GetUnownedFormFieldElements(doc.All(), nullptr); |
602 } | 602 } |
603 | 603 |
604 if (!password_form) | 604 if (!password_form) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 | 653 |
654 void PasswordGenerationAgent::LogNumber(Logger::StringID message_id, | 654 void PasswordGenerationAgent::LogNumber(Logger::StringID message_id, |
655 int number) { | 655 int number) { |
656 if (!password_agent_->logging_state_active()) | 656 if (!password_agent_->logging_state_active()) |
657 return; | 657 return; |
658 RendererSavePasswordProgressLogger logger(GetPasswordManagerDriver().get()); | 658 RendererSavePasswordProgressLogger logger(GetPasswordManagerDriver().get()); |
659 logger.LogNumber(message_id, number); | 659 logger.LogNumber(message_id, number); |
660 } | 660 } |
661 | 661 |
662 } // namespace autofill | 662 } // namespace autofill |
OLD | NEW |