| 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_NOTIFICATION_DISPLAY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // The events are received and dispatched to the right consumer depending on | 54 // The events are received and dispatched to the right consumer depending on |
| 55 // the type of notification. Consumers include, service workers, pages, | 55 // the type of notification. Consumers include, service workers, pages, |
| 56 // extensions... | 56 // extensions... |
| 57 void ProcessNotificationOperation(NotificationCommon::Operation operation, | 57 void ProcessNotificationOperation(NotificationCommon::Operation operation, |
| 58 NotificationCommon::Type notification_type, | 58 NotificationCommon::Type notification_type, |
| 59 const std::string& origin, | 59 const std::string& origin, |
| 60 const std::string& notification_id, | 60 const std::string& notification_id, |
| 61 int action_index, | 61 int action_index, |
| 62 const base::NullableString16& reply); | 62 const base::NullableString16& reply); |
| 63 | 63 |
| 64 // Return whether a notification of |notification_type| should be displayed |
| 65 // for |origin| when the browser is in full screen mode. |
| 66 bool ShouldDisplayOverFullscreen(const GURL& origin, |
| 67 NotificationCommon::Type notification_type); |
| 68 |
| 64 protected: | 69 protected: |
| 65 NotificationHandler* GetNotificationHandler( | 70 NotificationHandler* GetNotificationHandler( |
| 66 NotificationCommon::Type notification_type); | 71 NotificationCommon::Type notification_type); |
| 67 | 72 |
| 68 private: | 73 private: |
| 69 // Registers an implementation object to handle notification operations | 74 // Registers an implementation object to handle notification operations |
| 70 // for |notification_type|. | 75 // for |notification_type|. |
| 71 void AddNotificationHandler(NotificationCommon::Type notification_type, | 76 void AddNotificationHandler(NotificationCommon::Type notification_type, |
| 72 std::unique_ptr<NotificationHandler> handler); | 77 std::unique_ptr<NotificationHandler> handler); |
| 73 | 78 |
| 74 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> | 79 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> |
| 75 notification_handlers_; | 80 notification_handlers_; |
| 76 Profile* profile_; | 81 Profile* profile_; |
| 77 | 82 |
| 78 DISALLOW_COPY_AND_ASSIGN(NotificationDisplayService); | 83 DISALLOW_COPY_AND_ASSIGN(NotificationDisplayService); |
| 79 }; | 84 }; |
| 80 | 85 |
| 81 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_ | 86 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_ |
| OLD | NEW |