• Leonard Grey's avatar
    Hide WebContentsView when SadTab is shown, and show them when SadTab is · f9e09207
    Leonard Grey authored
    hidden.
    
    SadTabView is a little unique in that it's a views::View which is
    displayed on top of the web viewport. On macOS, this means that the
    event system hit tests mouse down events to the inner WebContentsView native
    view, instead of the outer BridgedContentView, which is responsible
    for passing events into the views subsystem.
    
    WebContentsView, on the other hand, is unaware of views at all, and
    has no way of knowing that a sad tab is installed, and it should forward
    events up to its superview for routing into the views system.
    
    One way to get around this issue without plumbing through extra event
    handling logic is to make it so events on the sad tab view hit test
    to the BridgedContentView in the first place by hiding it. This change
    facilitates that by propagating NativeViewHost's visibility to the
    contained native view.
    
    Bug: 896508
    Change-Id: I51875903bc61eb7baef0d58e40c7ca3f6773eecc
    Reviewed-on: https://chromium-review.googlesource.com/c/1334087
    Commit-Queue: Leonard Grey <lgrey@chromium.org>
    Reviewed-by: default avatarccameron <ccameron@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#609427}
    f9e09207
native_view_host.cc 8.19 KB