New issue
Advanced search Search tips

Issue 785519 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Combine AutofillDriver:WillSubmitForm & FormSubmitted

Project Member Reported by michaelbai@chromium.org, Nov 15 2017

Issue description

We changed to always call WillSubmitForm & FormSubmitted in sequence in https://chromium-review.googlesource.com/c/chromium/src/+/767619 , it is not make sense to have two methods now, we should consider to combine them to one method FormSubmitted(), and add parameter - known_success to indicate whether the submission is known to be success.


 
Cc: ma...@chromium.org rogerm@chromium.org
I am plan to

- Remove the AutofillDriver::WillSubmitForm()
- Change FormSubmitted to FormSubmitted(FormData form, bool success, mojo.common.mojom.TimeTicks timestamp)

Any concern about this?
Does this mean that FormSubmitted will called twice, once to signify the expectation that a submit is about to happen and once after the submission has happened?
FormSubmitted will called once because there is no need to have 2 calls now, FormTacker handles WillSendSubmitEvent() and calls OnProvisionallySaveForm() in Autofill agent, AutofillDriver::WillSubmitForm and AutofillDriver::FormSubmitted are always called together (note, this already happened in OnSameDocumentNavigation before the FormTracker added), we should just merge them.

Just found, it seems that mathp@ already had todo for this.
https://cs.chromium.org/chromium/src/components/autofill/core/browser/autofill_handler.h?rcl=8229631e3aca5b48c77211ce443c5947c7c42f4f&l=56
Think it twice, this is a issue here, the form could be different between RenderFrameObserver::WillSendSubmitEvent() and RenderFrameObserver::WillSubmitForm(), we should always use the form from WillSendSubmitEvent().

Sounds good? and this case should be covered by the tests.
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a674b1ddd40462bb41eef50f0befc6000d56c393

commit a674b1ddd40462bb41eef50f0befc6000d56c393
Author: Tao Bai <michaelbai@chromium.org>
Date: Thu Jan 18 22:33:43 2018

Combine AutofillDriver:WillSubmitForm & FormSubmitted

This patch fire submission in both WillSendSubmitEvent and
FormSubmitted(), to avoid to miss form submission, but only one
event will be sent to AutofillDriver.

Also pass SubmissionSource to browser side, and add the code to
handle PROBABLY_FORM_SUBMITTED in AutofillProviderAndroid.

Bug:  785519 
Change-Id: I7a732135da759f206547beb48995896bd58a85c6
Reviewed-on: https://chromium-review.googlesource.com/821610
Commit-Queue: Tao Bai <michaelbai@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Maxim Kolosovskiy <kolos@chromium.org>
Reviewed-by: Roger McFarlane <rogerm@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530305}
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/chrome/browser/autofill/autofill_browsertest.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/chrome/browser/autofill/autofill_provider_browsertest.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/chrome/renderer/autofill/autofill_renderer_browsertest.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/chrome/renderer/autofill/form_autocomplete_browsertest.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/chrome/test/BUILD.gn
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/android/autofill_provider_android.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/android/autofill_provider_android.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/browser/content_autofill_driver.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/browser/content_autofill_driver.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/common/autofill_driver.mojom
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/common/autofill_types.mojom
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/common/autofill_types.typemap
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/common/autofill_types_struct_traits.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/common/autofill_types_struct_traits.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/renderer/autofill_agent.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/renderer/autofill_agent.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/renderer/form_tracker.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/renderer/form_tracker.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/content/renderer/password_autofill_agent.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_handler.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_handler.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_handler_proxy.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_handler_proxy.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_manager.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_manager.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_manager_unittest.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_metrics_unittest.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/autofill_provider.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/credit_card_save_manager_unittest.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/test_autofill_manager.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/test_autofill_manager.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/test_autofill_provider.cc
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/browser/test_autofill_provider.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/common/BUILD.gn
[add] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/core/common/submission_source.h
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/autofill/ios/browser/autofill_agent.mm
[modify] https://crrev.com/a674b1ddd40462bb41eef50f0befc6000d56c393/components/password_manager/core/browser/password_form_manager_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment