• Abigail Klein's avatar
    [Live Caption] Only allow the caption bubble to activate when it is · a9319110
    Abigail Klein authored
    visible.
    
    On Windows, there is a bug where the caption bubble is focused after
    the tab model changes, even if the caption bubble had previously been
    deactivated. When the tab model changes, it causes focus to advance to
    the next focusable view and activate that view's widget. The fix for the
    caption bubble is to ensure that the caption bubble cannot be activated
    by the focus manager unless the caption bubble is visible.
    
    The stack trace of this behavior is:
    Browser::OnTabStripModelChanged
    Browser::OnTabDetached
    BrowserView::OnTabDetached
    views::WebView::SetWebContents
    views::WebView::UpdateCrashedOverlayView
    views::View::SetFocusBehavior
    views::View::AdvanceFocusIfNecessary
    views::FocusManager::AdvanceFocusIfNecessary
    views::FocusManager::AdvanceFocus
    views::FocusManager::SetFocusedViewWithReason
    views::Widget::Activate
    ...leading to...
    captions::CaptionBubble::OnWidgetActivationChanged
    
    One outstanding question is whether the focus manager should ever
    activate a widget that is not visible. This will be explored in a
    follow-up.
    
    Bug: 1055150, 1123635
    Change-Id: I9b5eaee54a5f78592c320b18282a726f9e0980eb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2558721
    Commit-Queue: Abigail Klein <abigailbklein@google.com>
    Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#830782}
    a9319110
caption_bubble.cc 30.9 KB