Chromium Code Reviews| Index: chrome/browser/notifications/notification_platform_bridge_mac.mm |
| diff --git a/chrome/browser/notifications/notification_ui_manager_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm |
| similarity index 95% |
| rename from chrome/browser/notifications/notification_ui_manager_mac.mm |
| rename to chrome/browser/notifications/notification_platform_bridge_mac.mm |
| index 1f343ee7407b4aae3d0f6d773a817f6af43787ad..c0ec36c1d203c11f67ef01038e6844e33f3e1cce 100644 |
| --- a/chrome/browser/notifications/notification_ui_manager_mac.mm |
| +++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/notifications/notification_ui_manager_mac.h" |
| +#include "chrome/browser/notifications/notification_platform_bridge_mac.h" |
| #include <utility> |
| @@ -55,7 +55,7 @@ NSString* const kNotificationIncognitoKey = @"notification_incognito"; |
| // static |
| NotificationPlatformBridge* NotificationPlatformBridge::Create() { |
| - return new NotificationUIManagerMac( |
| + return new NotificationPlatformBridgeMac( |
| [NSUserNotificationCenter defaultUserNotificationCenter]); |
| } |
| @@ -68,21 +68,21 @@ NotificationPlatformBridge* NotificationPlatformBridge::Create() { |
| // ///////////////////////////////////////////////////////////////////////////// |
| -NotificationUIManagerMac::NotificationUIManagerMac( |
| +NotificationPlatformBridgeMac::NotificationPlatformBridgeMac( |
| NSUserNotificationCenter* notification_center) |
| : delegate_([NotificationCenterDelegate alloc]), |
| notification_center_(notification_center) { |
| [notification_center_ setDelegate:delegate_.get()]; |
| } |
| -NotificationUIManagerMac::~NotificationUIManagerMac() { |
| +NotificationPlatformBridgeMac::~NotificationPlatformBridgeMac() { |
| [notification_center_ setDelegate:nil]; |
| // TODO(miguelg) lift this restriction if possible. |
| [notification_center_ removeAllDeliveredNotifications]; |
| } |
| -void NotificationUIManagerMac::Display(const std::string& notification_id, |
| +void NotificationPlatformBridgeMac::Display(const std::string& notification_id, |
| const std::string& profile_id, |
|
Peter Beverloo
2016/04/27 21:26:58
nit: alignment
Miguel Garcia
2016/04/27 21:35:41
Done.
|
| bool incognito, |
| const Notification& notification) { |
| @@ -179,9 +179,10 @@ void NotificationUIManagerMac::Display(const std::string& notification_id, |
| }; |
| [notification_center_ deliverNotification:toast]; |
| + notification.delegate()->Display(); |
|
Peter Beverloo
2016/04/27 21:26:58
Merge conflict? You unified this in the display ma
Miguel Garcia
2016/04/27 21:35:41
mm yes I don't know how this one sneaked in. Will
|
| } |
| -void NotificationUIManagerMac::Close(const std::string& profile_id, |
| +void NotificationPlatformBridgeMac::Close(const std::string& profile_id, |
| const std::string& notification_id) { |
|
Peter Beverloo
2016/04/27 21:26:58
nit: alignment
Miguel Garcia
2016/04/27 21:35:41
Done.
|
| NSString* candidate_id = base::SysUTF8ToNSString(notification_id); |
| @@ -201,7 +202,7 @@ void NotificationUIManagerMac::Close(const std::string& profile_id, |
| } |
| } |
| -bool NotificationUIManagerMac::GetDisplayed( |
| +bool NotificationPlatformBridgeMac::GetDisplayed( |
| const std::string& profile_id, |
| bool incognito, |
| std::set<std::string>* notifications) const { |
| @@ -219,7 +220,7 @@ bool NotificationUIManagerMac::GetDisplayed( |
| return true; |
| } |
| -bool NotificationUIManagerMac::SupportsNotificationCenter() const { |
| +bool NotificationPlatformBridgeMac::SupportsNotificationCenter() const { |
| return true; |
| } |