Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" | |
| 12 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "chrome/browser/notifications/notification_common.h" | 15 #include "chrome/browser/notifications/notification_common.h" |
| 15 #include "chrome/browser/notifications/notification_platform_bridge.h" | 16 #include "chrome/browser/notifications/notification_platform_bridge.h" |
| 16 | 17 |
| 17 class Notification; | 18 class Notification; |
| 18 @class NotificationCenterDelegate; | 19 @class NotificationCenterDelegate; |
| 19 @class NSDictionary; | 20 @class NSDictionary; |
| 20 @class NSUserNotificationCenter; | 21 @class NSUserNotificationCenter; |
| 21 class PrefService; | 22 class PrefService; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 39 bool GetDisplayed(const std::string& profile_id, | 40 bool GetDisplayed(const std::string& profile_id, |
| 40 bool incognito, | 41 bool incognito, |
| 41 std::set<std::string>* notifications) const override; | 42 std::set<std::string>* notifications) const override; |
| 42 bool SupportsNotificationCenter() const override; | 43 bool SupportsNotificationCenter() const override; |
| 43 | 44 |
| 44 // Validates contents of the |response| dictionary as received from the system | 45 // Validates contents of the |response| dictionary as received from the system |
| 45 // when a notification gets activated. | 46 // when a notification gets activated. |
| 46 static bool VerifyNotificationData(NSDictionary* response) WARN_UNUSED_RESULT; | 47 static bool VerifyNotificationData(NSDictionary* response) WARN_UNUSED_RESULT; |
| 47 | 48 |
| 48 private: | 49 private: |
| 50 FRIEND_TEST_ALL_PREFIXES(NotificationPlatformBridgeMacTest, | |
|
Robert Sesek
2016/07/12 17:33:36
Since this is just to gain access to the private c
Miguel Garcia
2016/07/13 14:05:16
Acknowledged.
| |
| 51 TestDisplayNoButtons); | |
| 52 FRIEND_TEST_ALL_PREFIXES(NotificationPlatformBridgeMacTest, | |
| 53 TestDisplayOneButton); | |
| 54 FRIEND_TEST_ALL_PREFIXES(NotificationPlatformBridgeMacTest, TestClose); | |
| 55 | |
| 56 // Used directly in tests. | |
| 57 NotificationPlatformBridgeMac(NSUserNotificationCenter* notification_center, | |
| 58 bool set_delegate); | |
| 59 | |
| 49 // Cocoa class that receives callbacks from the NSUserNotificationCenter. | 60 // Cocoa class that receives callbacks from the NSUserNotificationCenter. |
| 50 base::scoped_nsobject<NotificationCenterDelegate> delegate_; | 61 base::scoped_nsobject<NotificationCenterDelegate> delegate_; |
| 51 | 62 |
| 52 // The notification center to use, this can be overriden in tests | 63 // The notification center to use, this can be overriden in tests |
| 53 NSUserNotificationCenter* notification_center_; | 64 NSUserNotificationCenter* notification_center_; |
| 54 | 65 |
| 55 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeMac); | 66 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeMac); |
| 56 }; | 67 }; |
| 57 | 68 |
| 58 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ | 69 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ |
| OLD | NEW |