Chromium Code Reviews| Index: chrome/browser/notifications/notification_platform_bridge_mac.mm |
| diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm |
| index e96756be9d07f2003944297157bc9d80f3a2cb7c..31ab0774efde0c56369544b50d76f3ad2e73a9ce 100644 |
| --- a/chrome/browser/notifications/notification_platform_bridge_mac.mm |
| +++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm |
| @@ -91,10 +91,18 @@ NotificationPlatformBridge* NotificationPlatformBridge::Create() { |
| // ///////////////////////////////////////////////////////////////////////////// |
| NotificationPlatformBridgeMac::NotificationPlatformBridgeMac( |
| - NSUserNotificationCenter* notification_center) |
| + NSUserNotificationCenter* notification_center) { |
| + NotificationPlatformBridgeMac(notification_center, true /* set_delegate */); |
|
Peter Beverloo
2016/07/11 17:25:48
You can define a delegating constructor like:
Not
Miguel Garcia
2016/07/12 16:16:24
You know I usually go with the flow with regards t
|
| +} |
| + |
| +NotificationPlatformBridgeMac::NotificationPlatformBridgeMac( |
| + NSUserNotificationCenter* notification_center, |
| + bool set_delegate) |
| : delegate_([NotificationCenterDelegate alloc]), |
| notification_center_(notification_center) { |
| - [notification_center_ setDelegate:delegate_.get()]; |
| + // Setting up the delegte upsets OCMock. |
|
Peter Beverloo
2016/07/11 17:25:48
delegte -> delegate
Rather than saying that it "u
Miguel Garcia
2016/07/12 16:16:24
Now that we know why sure :)
|
| + if (set_delegate) |
| + notification_center.delegate = delegate_.get(); |
|
Peter Beverloo
2016/07/11 17:25:48
Why did the syntax for the assignment change?
Miguel Garcia
2016/07/12 16:16:24
It was me trying some things to keep OCMock happy,
|
| } |
| NotificationPlatformBridgeMac::~NotificationPlatformBridgeMac() { |