| 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 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const std::string& profile_id, | 36 const std::string& profile_id, |
| 37 bool incognito, | 37 bool incognito, |
| 38 const Notification& notification) override; | 38 const Notification& notification) override; |
| 39 | 39 |
| 40 void Close(const std::string& profile_id, | 40 void Close(const std::string& profile_id, |
| 41 const std::string& notification_id) override; | 41 const std::string& notification_id) override; |
| 42 void GetDisplayed( | 42 void GetDisplayed( |
| 43 const std::string& profile_id, | 43 const std::string& profile_id, |
| 44 bool incognito, | 44 bool incognito, |
| 45 const GetDisplayedNotificationsCallback& callback) const override; | 45 const GetDisplayedNotificationsCallback& callback) const override; |
| 46 void SetReadyCallback(NotificationBridgeReadyCallback callback) override; |
| 46 | 47 |
| 47 // Processes a notification response generated from a user action | 48 // Processes a notification response generated from a user action |
| 48 // (click close, etc.). | 49 // (click close, etc.). |
| 49 static void ProcessNotificationResponse(NSDictionary* response); | 50 static void ProcessNotificationResponse(NSDictionary* response); |
| 50 | 51 |
| 51 // Validates contents of the |response| dictionary as received from the system | 52 // Validates contents of the |response| dictionary as received from the system |
| 52 // when a notification gets activated. | 53 // when a notification gets activated. |
| 53 static bool VerifyNotificationData(NSDictionary* response) WARN_UNUSED_RESULT; | 54 static bool VerifyNotificationData(NSDictionary* response) WARN_UNUSED_RESULT; |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 // Cocoa class that receives callbacks from the NSUserNotificationCenter. | 57 // Cocoa class that receives callbacks from the NSUserNotificationCenter. |
| 57 base::scoped_nsobject<NotificationCenterDelegate> delegate_; | 58 base::scoped_nsobject<NotificationCenterDelegate> delegate_; |
| 58 | 59 |
| 59 // The notification center to use for local banner notifications, | 60 // The notification center to use for local banner notifications, |
| 60 // this can be overriden in tests. | 61 // this can be overriden in tests. |
| 61 base::scoped_nsobject<NSUserNotificationCenter> notification_center_; | 62 base::scoped_nsobject<NSUserNotificationCenter> notification_center_; |
| 62 | 63 |
| 63 // The object in charge of dispatching remote notifications. | 64 // The object in charge of dispatching remote notifications. |
| 64 base::scoped_nsprotocol<id<AlertDispatcher>> alert_dispatcher_; | 65 base::scoped_nsprotocol<id<AlertDispatcher>> alert_dispatcher_; |
| 65 | 66 |
| 66 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeMac); | 67 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeMac); |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ | 70 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_MAC_H_ |
| OLD | NEW |