• Avi Drissman's avatar
    Fix fullscreen dropping for security · 33972945
    Avi Drissman authored
    If a WebContents performs a UI-sensitive action (such as showing a
    dialog or popup), we want to drop fullscreen from all related
    WebContentses, and to prevent those WebContentses from gaining
    fullscreen until the UI-sensitive situation is over.
    
    Currently the search for related WebContentses is achieved by walking
    up the opener and outer chains, but that misses related WebContentses
    that are down those chains. These are one-directional chains that
    aren't easily walked in the other direction.
    
    This is fixed with two changes.
    
    First, we keep a list of WebContentses that are in fullscreen, which
    can then be searched to determine if they are down the chain from the
    affected WebContents.
    
    Second, when a request comes in to go fullscreen, we not only check if
    the WebContents is prohibited from entering fullscreen, but we now
    also check if one of the WebContentses up the chain is prohibited.
    
    Bug: 1090835
    Change-Id: I031e2e0a9ff79b387543a22ec3d643ab468d4d29
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2249090
    Commit-Queue: Charlie Harrison <csharrison@chromium.org>
    Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
    Auto-Submit: Avi Drissman <avi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#780290}
    33972945
web_contents_impl_browsertest.cc 164 KB