| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 NotificationCommon::Type notification_type, | 49 NotificationCommon::Type notification_type, |
| 50 const std::string& origin, | 50 const std::string& origin, |
| 51 const std::string& notification_id, | 51 const std::string& notification_id, |
| 52 int action_index, | 52 int action_index, |
| 53 const base::NullableString16& reply); | 53 const base::NullableString16& reply); |
| 54 | 54 |
| 55 // Registers an implementation object to handle notification operations | 55 // Registers an implementation object to handle notification operations |
| 56 // for |notification_type|. | 56 // for |notification_type|. |
| 57 void AddNotificationHandler(NotificationCommon::Type notification_type, | 57 void AddNotificationHandler(NotificationCommon::Type notification_type, |
| 58 std::unique_ptr<NotificationHandler> handler); | 58 std::unique_ptr<NotificationHandler> handler); |
| 59 | |
| 60 // Removes an implementation added via |AddNotificationHandler|. | |
| 61 void RemoveNotificationHandler(NotificationCommon::Type notification_type); | |
| 62 | |
| 63 private: | 59 private: |
| 64 NotificationHandler* GetNotificationHandler( | 60 NotificationHandler* GetNotificationHandler( |
| 65 NotificationCommon::Type notification_type); | 61 NotificationCommon::Type notification_type); |
| 66 | 62 |
| 67 // Called by |notification_bridge_| when it is finished | 63 // Called by |notification_bridge_| when it is finished |
| 68 // initializing. |success| indicates it is ready to be used. | 64 // initializing. |success| indicates it is ready to be used. |
| 69 void OnNotificationPlatformBridgeReady(bool success); | 65 void OnNotificationPlatformBridgeReady(bool success); |
| 70 | 66 |
| 71 Profile* profile_; | 67 Profile* profile_; |
| 72 | 68 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 84 | 80 |
| 85 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> | 81 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> |
| 86 notification_handlers_; | 82 notification_handlers_; |
| 87 | 83 |
| 88 base::WeakPtrFactory<NativeNotificationDisplayService> weak_factory_; | 84 base::WeakPtrFactory<NativeNotificationDisplayService> weak_factory_; |
| 89 | 85 |
| 90 DISALLOW_COPY_AND_ASSIGN(NativeNotificationDisplayService); | 86 DISALLOW_COPY_AND_ASSIGN(NativeNotificationDisplayService); |
| 91 }; | 87 }; |
| 92 | 88 |
| 93 #endif // CHROME_BROWSER_NOTIFICATIONS_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ | 89 #endif // CHROME_BROWSER_NOTIFICATIONS_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ |
| OLD | NEW |