Chromium Code Reviews| Index: chrome/browser/notifications/native_notification_display_service.h |
| diff --git a/chrome/browser/notifications/native_notification_display_service.h b/chrome/browser/notifications/native_notification_display_service.h |
| index f5c8fee36b42b7e907a73a1b65de07536f2095b2..b783a54b77c84c322e845c1b7ebabb602e62a22a 100644 |
| --- a/chrome/browser/notifications/native_notification_display_service.h |
| +++ b/chrome/browser/notifications/native_notification_display_service.h |
| @@ -7,10 +7,12 @@ |
| #include <map> |
| #include <memory> |
| +#include <queue> |
| #include <set> |
| #include <string> |
| #include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "chrome/browser/notifications/notification_common.h" |
| #include "chrome/browser/notifications/notification_display_service.h" |
| @@ -18,6 +20,7 @@ namespace base { |
| class NullableString16; |
| } |
| +class MessageCenterDisplayService; |
| class Notification; |
| class NotificationHandler; |
| class NotificationPlatformBridge; |
| @@ -60,11 +63,36 @@ class NativeNotificationDisplayService : public NotificationDisplayService { |
| NotificationHandler* GetNotificationHandler( |
| NotificationCommon::Type notification_type); |
| + // Called by |notification_bridge_| when it is finished |
| + // initializing. |success| indicates it is ready to be used. |
| + void OnNotificationPlatformBridgeInitialized(bool success); |
| + |
| + void DisplayNow(NotificationCommon::Type notification_type, |
| + const std::string& notification_id, |
| + const Notification& notification); |
| + void CloseNow(NotificationCommon::Type notification_type, |
| + const std::string& notification_id); |
| + void GetDisplayedNow(const DisplayedNotificationsCallback& callback); |
|
Peter Beverloo
2017/04/25 15:16:55
These three methods don't exist in the .cc
Tom (Use chromium acct)
2017/04/25 18:35:21
Oops, removed
|
| + |
| Profile* profile_; |
| + |
| NotificationPlatformBridge* notification_bridge_; |
| + // Is |notification_bridge_| ready to be used? |
| + bool notification_bridge_connected_; |
| + |
| + // MessageCenterDisplayService to fallback on if initialization of |
| + // |notification_bridge_| failed. |
| + std::unique_ptr<MessageCenterDisplayService> message_center_display_service_; |
| + |
| + // Tasks that need to be run once we have the initialization status |
| + // for |notification_bridge_|. |
| + std::queue<base::Closure> actions_; |
|
Peter Beverloo
2017/04/25 15:16:55
nit: base::OnceClosure
Tom (Use chromium acct)
2017/04/25 18:35:21
Done.
|
| + |
| std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> |
| notification_handlers_; |
| + base::WeakPtrFactory<NativeNotificationDisplayService> weak_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(NativeNotificationDisplayService); |
| }; |