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