| 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 | |
| 69 protected: | 64 protected: |
| 70 NotificationHandler* GetNotificationHandler( | 65 NotificationHandler* GetNotificationHandler( |
| 71 NotificationCommon::Type notification_type); | 66 NotificationCommon::Type notification_type); |
| 72 | 67 |
| 73 private: | 68 private: |
| 74 // Registers an implementation object to handle notification operations | 69 // Registers an implementation object to handle notification operations |
| 75 // for |notification_type|. | 70 // for |notification_type|. |
| 76 void AddNotificationHandler(NotificationCommon::Type notification_type, | 71 void AddNotificationHandler(NotificationCommon::Type notification_type, |
| 77 std::unique_ptr<NotificationHandler> handler); | 72 std::unique_ptr<NotificationHandler> handler); |
| 78 | 73 |
| 79 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> | 74 std::map<NotificationCommon::Type, std::unique_ptr<NotificationHandler>> |
| 80 notification_handlers_; | 75 notification_handlers_; |
| 81 Profile* profile_; | 76 Profile* profile_; |
| 82 | 77 |
| 83 DISALLOW_COPY_AND_ASSIGN(NotificationDisplayService); | 78 DISALLOW_COPY_AND_ASSIGN(NotificationDisplayService); |
| 84 }; | 79 }; |
| 85 | 80 |
| 86 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_ | 81 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DISPLAY_SERVICE_H_ |
| OLD | NEW |