OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_IN_PAGE_NOTIFICATION_HANDLER_H_ | |
6 #define CHROME_BROWSER_NOTIFICATIONS_IN_PAGE_NOTIFICATION_HANDLER_H_ | |
7 | |
8 #include <memory> | |
9 #include <unordered_map> | |
10 | |
11 #include "base/macros.h" | |
12 #include "chrome/browser/notifications/notification_handler.h" | |
13 | |
14 class Notification; | |
15 | |
16 // NotificationHandler implementation for non persistent | |
17 // notifications. | |
18 class InPageNotificationHandler : public NotificationHandler { | |
Peter Beverloo
2016/06/29 00:23:15
Please be consistent in your terminology. We have
Miguel Garcia
2016/07/05 13:54:50
Renamed to NonPersistentNotificationHandler Adding
| |
19 public: | |
20 InPageNotificationHandler(); | |
21 ~InPageNotificationHandler() override; | |
22 | |
23 void HandleNotificationOperation( | |
24 notification_operation_common::NotificationOperation operation, | |
25 Profile* profile, | |
26 const std::string& origin, | |
27 const std::string& notification_id, | |
28 int action_index) override; | |
29 | |
30 void RegisterNotification( | |
31 const std::string& notification_id, | |
32 std::unique_ptr<Notification> notification) override; | |
33 | |
34 void CloseNotification(Profile* profile, | |
35 const std::string& notification_id) override; | |
36 | |
37 notification_operation_common::NotificationHandlerType NotificationType() | |
38 override; | |
39 | |
40 private: | |
41 // map of in page Notification objects keyed by notification id. | |
42 std::unordered_map<std::string, std::unique_ptr<Notification>> notifications_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(InPageNotificationHandler); | |
45 }; | |
46 | |
47 #endif // CHROME_BROWSER_NOTIFICATIONS_IN_PAGE_NOTIFICATION_HANDLER_H_ | |
OLD | NEW |