New issue
Advanced search Search tips

Issue 776443 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Simplift NotificationPlatformBridge interface

Project Member Reported by est...@chromium.org, Oct 19 2017

Issue description

NotificationPlatformBridge should be a lot simpler. For example, Display() should only have a Notification and a Metadata argument, all considerations of profile and notification type are not relevant to native notification systems and should be a higher level concern (i.e. NativeNotificationDisplayService). As it stands, each NPB implementation has to duplicate a lot of code converting notification IDs and tracking active notifications. This work should be done in NativeNotificationDisplayService.

NativeNotificationDisplayService can implement a simple interface that acts as its API for each NPB implementation, along the lines of

class NotificationPlatformBridgeDelegate {
 public:
  virtual void HandleNotificationClosed(const std::string& id,
                                        bool by_user) = 0;
  virtual void HandleNotificationClicked(const std::string& id) = 0;
  virtual void HandleNotificationButtonClicked(const std::string& id,
                                       int button_index) = 0;
};

Connecting the events to the NotificationDisplayService for the correct profile, tracking the NotificationCommon::Type, etc., will then not be necessary for each NPB.
 

Comment 1 by est...@chromium.org, Oct 19 2017

Note that I am creating the ChromeOs/Ash NPB currently, and I'm splitting it into two classes that mirrors what's described above. That is, the new NotificationPlatformBridgeChromeOs contains code that should be in NativeNotificationDisplayService and the new NotificationPlatformBridgeChromeOsImpl contains only that which actually belongs in NotificationPlatformBridge.
Labels: -OS-iOS

Comment 3 by est...@chromium.org, Dec 15 2017

Status: WontFix (was: Available)
I'm just gonna close this because there are already plans underway to change NPB substantially.

Sign in to add a comment