• Balazs Engedy's avatar
    WebAuthn: use WebContents::GetVisibility for focus checks. · 9311dc38
    Balazs Engedy authored
    After this CL, the focus checks performed by navigator.credentials.create()
    requests will now succeed when called from the foreground tab in a browser
    window, even if the window is not currently the active window. Invocations
    from minimized windows and background tabs are still rejected. On platforms
    with Visibility::OCCLUDED support, occluded windows are also considered to
    be unfocused.
    
    Furthermore, the CL has two side effects:
     -- Foreground WebContents that are currently showing a permission bubble
        or a web-modal dialog are now considered to be "focused" on all
        desktop platforms. The special handling in AuthenticatorImpl is no
        longer needed.
     -- On Linux, the foreground tab in a browser window on an inactive virtual
        screen is still considered to be focused.
    
    While this may very well not be the right approach going forwards, it will
    allow consistent behavior regardless of whether the WebAuthn UI is enabled
    or disabled. (With UI enabled, focus checks are replaced by checking if the
    WebAuthn dialog is currently shown.)
    
    Bug: 849323
    Change-Id: I3afc542bed3765be1e43c2fa348fc5b67a8b2aef
    Reviewed-on: https://chromium-review.googlesource.com/1092859Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
    Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
    Reviewed-by: default avatarAdam Langley <agl@chromium.org>
    Commit-Queue: Balazs Engedy <engedy@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#567249}
    9311dc38
authenticator_impl.cc 31.2 KB