| 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..75805621296fa0eb1e27f29741b025bec27a727c 100644
|
| --- a/components/autofill/content/renderer/password_autofill_agent.cc
|
| +++ b/components/autofill/content/renderer/password_autofill_agent.cc
|
| @@ -1032,13 +1032,19 @@ void PasswordAutofillAgent::OnDynamicFormsSeen() {
|
| }
|
|
|
| void PasswordAutofillAgent::AJAXSucceeded() {
|
| - OnSameDocumentNavigationCompleted();
|
| + OnSameDocumentNavigationCompleted(false);
|
| }
|
|
|
| -void PasswordAutofillAgent::OnSameDocumentNavigationCompleted() {
|
| +void PasswordAutofillAgent::OnSameDocumentNavigationCompleted(
|
| + bool is_inpage_navigation) {
|
| if (!provisionally_saved_form_.IsPasswordValid())
|
| return;
|
|
|
| + provisionally_saved_form_.SetSubmissionIndicatorEvent(
|
| + is_inpage_navigation
|
| + ? PasswordForm::SubmissionIndicatorEvent::INPAGE_NAVIGATION
|
| + : PasswordForm::SubmissionIndicatorEvent::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 +1215,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 +1227,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_.SetSubmissionIndicatorEvent(
|
| + PasswordForm::SubmissionIndicatorEvent::FRAME_DETACHED);
|
| GetPasswordManagerDriver()->InPageNavigation(
|
| provisionally_saved_form_.password_form());
|
| }
|
| @@ -1280,6 +1288,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::SubmissionIndicatorEvent::HTML_FORM_SUBMISSION;
|
| }
|
|
|
| // Some observers depend on sending this information now instead of when
|
| @@ -1563,6 +1573,8 @@ void PasswordAutofillAgent::FindFocusedPasswordForm(
|
| if (!password_form)
|
| password_form.reset(new PasswordForm());
|
|
|
| + password_form->submission_event =
|
| + PasswordForm::SubmissionIndicatorEvent::BY_CONTEXT_MENU_CLICK;
|
| callback.Run(*password_form);
|
| }
|
|
|
|
|