• Colin Blundell's avatar
    WebLayer/WebView autofill: Properly handle webpage reload · 47bcc5fa
    Colin Blundell authored
    Currently WebLayer/WebView's shared autofill implementation doesn't
    properly reset state on webpage reload. This results in buggy behavior
    as the implementation treats the user's session after reload as a
    continuation of the before-reload session rather than a new session
    (see [1] for details).
    
    This CL fixes the problem by having AutofillProviderAndroid reset its
    state on receiving a notification to do so from ContentAutofillDriver.
    This notification is made when a different-documentation navigation is
    made. As detailed in [1], a reload is always treated as a
    different-document navigation by //content.
    
    We also add a test of that autofill starts a new session in this case,
    which fails without the change made in this CL.
    
    To manually verify: Go to accounts.google.com in WebLayer Shell, focus
    on the username field to trigger the autofill popup, reload the page,
    focus on the username field again, and verify that the autofill popup
    triggers again.
    
    [1] https://docs.google.com/document/d/1tyQ5XQLssIoa1AIPJ9WjOnW6-lPZpmpSrxkf5-6HYgc/edit#heading=h.u1hpn0gmjp2e (internal-only, apologies)
    
    Bug: 1117563
    Change-Id: If6f95aa1fea9dccf0f24a860758fd323d9714c2e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409492Reviewed-by: default avatarMichael Bai <michaelbai@chromium.org>
    Commit-Queue: Colin Blundell <blundell@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#810107}
    47bcc5fa
autofill_provider_android.cc 13.6 KB