• Tetsui Ohkubo's avatar
    Fix MessagePopupCollection crash on small screen. · ecd1e322
    Tetsui Ohkubo authored
    This CL fixes a reentrancy issue in MessagePopupCollection that might
    cause crash on devices with small screen height.
    We should set |is_updating_| to true when we call MessagePopupView::
    UpdateContents(). Updating contents can change its height, and it might
    cause the popup to be dismissed because the screen height might not be
    enough to show the notification. The popup should be closed after the
    update is finished, but we didn't set |is_updating_| to true, so the
    popup could accidentally close during UpdateContents().
    
    We didn't catch this until a11y related change
    https://crrev.com/c/1166231 because |message_view_| was not used after
    NotifyPopupResized() in MessagePopupView::UpdateContents().
    
    TEST=MessagePopupCollection.UpdateContentsCausesPopupClose
    BUG=874777
    
    Change-Id: I29cfffec7e967254da0d880667e38805d0cded5a
    Reviewed-on: https://chromium-review.googlesource.com/1179506
    Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
    Reviewed-by: default avatarEvan Stade <estade@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#584362}
    ecd1e322
message_popup_view.cc 6.75 KB