Push API: Grace - allow one in ten pushes to show no notification.
For developers who have opted in to showing a user-visible UI change on every push (in exchange for showing the user a less scary permission prompt), we currently[1] enforce that each push shows a notification. This patch allows one in ten pushes to show no notification, so occasional bugs in developer push handlers don't needlessly spam the user. Specifically, it keeps track of whether the last (up to) 10 push messages showed a notification (ignoring pushes didn't show a notification but were exempt, e.g. due to https://crrev.com/866443003) and only shows a forced notification if one of those (up to) 10 also failed to show a notification. [1]: (since https://crrev.com/842233003) BUG=437277 Review URL: https://codereview.chromium.org/883743002 Cr-Commit-Position: refs/heads/master@{#314851}
Showing
Please register or sign in to comment