CrOS Shelf: Use AppRegistryCache for shelf notification badging
Before this, the MessageCenterObserver was used to allow the ShelfModel to keep track of existing notifications. This allowed the ShelfModel to correctly update the apps that had a notification. In this CL, the ShelfController no longer observes the MessageCenter and instead observes the AppRegistryCache to get notification updates. With this method, the ShelfModel no longer needs to keep a map of existing notifications. Instead, the AppRegistryCache calls OnAppUpdate() whenever an app's notification badge status has changed. Also, in order to get the initial notification badge status for new ShelfItems, the ShelfControlelr observes changes to the ShelfModel. When a new item is added to the model, the ShelfController uses the AppRegistryCache to update the model with the current notification badge status. Bug: 1080827 Change-Id: I1c37626170387a8e81cec0f6f3c06026ac62a976 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219164Reviewed-by:Nancy Wang <nancylingwang@chromium.org> Reviewed-by:
Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Matthew Mourgos <mmourgos@chromium.org> Cr-Commit-Position: refs/heads/master@{#786304}
Showing
Please register or sign in to comment