I noticed this when working on https://crrev.com/c/737495. The BottomSheet.StateChangeReason enum has a NEW_TAB value, but the onSheetClosed observer event gets fired with a reason of NONE.
We suppress modal permission prompts while the bottom sheet is open, and when it's closed, we want drop the request entirely if onSheetClosed is fired with NAVIGATION or NEW_TAB. For new tabs, we don't actually get NEW_TAB. Example repro (use canary or ToT):
- Visit https://output.jsbin.com/komogeq
- Click "5s notif" (this waits 5s then requests notifications)
- Tap 3-dot menu, "New tab"
- Wait 5s to ensure the site has requested notifications
- Pick a website to open
- Modal permission prompt shouldn't be shown
Comment 1 by danielpark@chromium.org
, Mar 6 2018