• Tetsui Ohkubo's avatar
    Reland "Collapse older notification popups." · 047fee01
    Tetsui Ohkubo authored
    This is a reland of 4497e01a.
    
    Change fron the original CL (PatchSet #1):
    * Loop over existing toasts in a way that won't crash when a toast is
      removed mid-loop. SetExpanded may cause the toast to be removed.
      See the comment for detail.
    
    Original change's description:
    > Do not close widget in TrayBubbleView for notification center.
    >
    > This is a follow-up CL of https://crrev.com/c/816778 .
    >
    > There were three code paths to close notification center:
    > * Only WebNotificationTray::HideMessageCenter is called.
    >   (clicking on tray bell icon)
    > + TrayBubbleWrapper::OnWindowActivated is called in addition.
    >   (pressing search button)
    > + TrayBubbleView::OnWidgetActivationChanged is called in addition.
    >   (clicking on screenshot notification in notification center)
    >
    > On the last code path, Widget::Close() is called before
    > WebNotificationTray::HideMessageCenter().
    > HideMessageCenter() assumed the widget is still open, thus the crash
    > https://crbug.com/792583#c14 was caused.
    >
    > The quick fix CL fixed HideMessageCenter(), but it is confusing that
    > the widget can be closed through multiple code paths.
    > This CL uses TrayBubbleView::InitParams::close_on_deactivate so that
    > the TrayBubbleView does not close the widget.
    >
    > TEST=manual
    > BUG=792583
    >
    > Change-Id: Ibff47189719043d6ec6830f50888c8323e63f44a
    > Reviewed-on: https://chromium-review.googlesource.com/833429
    > Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
    > Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#528866}
    
    TEST=MessagePopupCollectionTest.AddedAndRemovedAtSameTime
    BUG=792583,804389
    
    Change-Id: I79257b3c64e27926687f50284d7c3e2d03375c28
    Reviewed-on: https://chromium-review.googlesource.com/886101
    Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
    Reviewed-by: default avatarEvan Stade <estade@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#532767}
    047fee01
toast_contents_view.h 5.25 KB