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 <set> | 10 #include <set> |
(...skipping 22 matching lines...) Expand all Loading... | |
33 ~NativeNotificationDisplayService() override; | 33 ~NativeNotificationDisplayService() override; |
34 | 34 |
35 // NotificationDisplayService implementation. | 35 // NotificationDisplayService implementation. |
36 void Display(NotificationCommon::Type notification_type, | 36 void Display(NotificationCommon::Type notification_type, |
37 const std::string& notification_id, | 37 const std::string& notification_id, |
38 const Notification& notification) override; | 38 const Notification& notification) override; |
39 void Close(NotificationCommon::Type notification_type, | 39 void Close(NotificationCommon::Type notification_type, |
40 const std::string& notification_id) override; | 40 const std::string& notification_id) override; |
41 bool GetDisplayed(std::set<std::string>* notifications) const override; | 41 bool GetDisplayed(std::set<std::string>* notifications) const override; |
42 | 42 |
43 void GetDisplayedAsync(const NotificationCommon::NotificationResultCallback& | |
Peter Beverloo
2017/02/24 16:12:23
nit: no blank line
Miguel Garcia
2017/03/22 22:00:06
Done.
| |
44 callback) const override; | |
45 | |
43 // Used by the notification bridge to propagate back events (click, close...). | 46 // Used by the notification bridge to propagate back events (click, close...). |
44 void ProcessNotificationOperation(NotificationCommon::Operation operation, | 47 void ProcessNotificationOperation(NotificationCommon::Operation operation, |
45 NotificationCommon::Type notification_type, | 48 NotificationCommon::Type notification_type, |
46 const std::string& origin, | 49 const std::string& origin, |
47 const std::string& notification_id, | 50 const std::string& notification_id, |
48 int action_index, | 51 int action_index, |
49 const base::NullableString16& reply); | 52 const base::NullableString16& reply); |
50 | 53 |
51 // Registers an implementation object to handle notification operations | 54 // Registers an implementation object to handle notification operations |
52 // for |notification_type|. | 55 // for |notification_type|. |
53 void AddNotificationHandler(NotificationCommon::Type notification_type, | 56 void AddNotificationHandler(NotificationCommon::Type notification_type, |
54 std::unique_ptr<NotificationHandler> handler); | 57 std::unique_ptr<NotificationHandler> handler); |
55 | 58 |
56 // Removes an implementation added via |AddNotificationHandler|. | 59 // Removes an implementation added via |AddNotificationHandler|. |
57 void RemoveNotificationHandler(NotificationCommon::Type notification_type); | 60 void RemoveNotificationHandler(NotificationCommon::Type notification_type); |
58 | 61 |
59 private: | 62 private: |
60 NotificationHandler* GetNotificationHandler( | 63 NotificationHandler* GetNotificationHandler( |
61 NotificationCommon::Type notification_type); | 64 NotificationCommon::Type notification_type); |
62 | 65 |
63 Profile* profile_; | 66 Profile* profile_; |
64 NotificationPlatformBridge* notification_bridge_; | 67 NotificationPlatformBridge* notification_bridge_; |
65 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> | 68 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> |
66 notification_handlers_; | 69 notification_handlers_; |
67 | 70 |
68 DISALLOW_COPY_AND_ASSIGN(NativeNotificationDisplayService); | 71 DISALLOW_COPY_AND_ASSIGN(NativeNotificationDisplayService); |
69 }; | 72 }; |
70 | 73 |
71 #endif // CHROME_BROWSER_NOTIFICATIONS_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ | 74 #endif // CHROME_BROWSER_NOTIFICATIONS_NATIVE_NOTIFICATION_DISPLAY_SERVICE_H_ |
OLD | NEW |