Chromium Code Reviews| Index: components/autofill/content/renderer/password_autofill_agent.cc |
| diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc |
| index 062823790691580d1b96b309733e65eb693cc7be..d05f611ec014f630449983ca0698b548378489ef 100644 |
| --- a/components/autofill/content/renderer/password_autofill_agent.cc |
| +++ b/components/autofill/content/renderer/password_autofill_agent.cc |
| @@ -1032,13 +1032,18 @@ void PasswordAutofillAgent::OnDynamicFormsSeen() { |
| } |
| void PasswordAutofillAgent::AJAXSucceeded() { |
| - OnSameDocumentNavigationCompleted(); |
| + OnSameDocumentNavigationCompleted(false); |
| } |
| -void PasswordAutofillAgent::OnSameDocumentNavigationCompleted() { |
| +void PasswordAutofillAgent::OnSameDocumentNavigationCompleted( |
|
engedy
2017/05/09 22:02:58
nit: Now this sounds like: OnBanana(bool is_banana
dvadym
2017/05/10 12:10:12
Absolutely agree. But I'd prefer to use this CL ju
engedy
2017/05/10 13:07:42
Acknowledged.
|
| + bool is_inpage_navigation) { |
| if (!provisionally_saved_form_.IsPasswordValid()) |
| return; |
| + provisionally_saved_form_.SetSubmissionEvent( |
| + is_inpage_navigation ? PasswordForm::SubmissionEvent::INPAGE_NAVIGATION |
| + : PasswordForm::SubmissionEvent::XHR_SUCCEEDED); |
| + |
| // Prompt to save only if the form is now gone, either invisible or |
| // removed from the DOM. |
| blink::WebFrame* frame = render_frame()->GetWebFrame(); |
| @@ -1209,7 +1214,7 @@ void PasswordAutofillAgent::DidCommitProvisionalLoad( |
| bool is_new_navigation, |
| bool is_same_document_navigation) { |
| if (is_same_document_navigation) { |
| - OnSameDocumentNavigationCompleted(); |
| + OnSameDocumentNavigationCompleted(true); |
| } else { |
| checked_safe_browsing_reputation_ = false; |
| } |
| @@ -1221,6 +1226,8 @@ void PasswordAutofillAgent::FrameDetached() { |
| // for examples of sites that perform login using this technique. |
| if (render_frame()->GetWebFrame()->Parent() && |
| provisionally_saved_form_.IsPasswordValid()) { |
| + provisionally_saved_form_.SetSubmissionEvent( |
| + PasswordForm::SubmissionEvent::FRAME_DETACHED); |
| GetPasswordManagerDriver()->InPageNavigation( |
| provisionally_saved_form_.password_form()); |
| } |
| @@ -1280,6 +1287,8 @@ void PasswordAutofillAgent::WillSubmitForm(const blink::WebFormElement& form) { |
| submitted_form->password_value = saved_form.password_value; |
| submitted_form->new_password_value = saved_form.new_password_value; |
| submitted_form->username_value = saved_form.username_value; |
| + submitted_form->submission_event = |
| + PasswordForm::SubmissionEvent::HTML_FORM_SUBMISSION; |
| } |
| // Some observers depend on sending this information now instead of when |
| @@ -1563,6 +1572,8 @@ void PasswordAutofillAgent::FindFocusedPasswordForm( |
| if (!password_form) |
| password_form.reset(new PasswordForm()); |
| + password_form->submission_event = |
| + PasswordForm::SubmissionEvent::BY_CONTEXT_MENU_CLICK; |
| callback.Run(*password_form); |
| } |