OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 ~Notification() override; | 83 ~Notification() override; |
84 | 84 |
85 void close(); | 85 void close(); |
86 | 86 |
87 DEFINE_ATTRIBUTE_EVENT_LISTENER(click); | 87 DEFINE_ATTRIBUTE_EVENT_LISTENER(click); |
88 DEFINE_ATTRIBUTE_EVENT_LISTENER(show); | 88 DEFINE_ATTRIBUTE_EVENT_LISTENER(show); |
89 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 89 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
90 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 90 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
91 | 91 |
92 // WebNotificationDelegate interface. | 92 // WebNotificationDelegate interface. |
93 void dispatchShowEvent() override; | 93 void didShowNotification(const WebString& notificationId) override; |
94 void dispatchClickEvent() override; | 94 void didClickNotification() override; |
95 void dispatchErrorEvent() override; | 95 void didCloseNotification() override; |
96 void dispatchCloseEvent() override; | |
97 | 96 |
98 String title() const; | 97 String title() const; |
99 String dir() const; | 98 String dir() const; |
100 String lang() const; | 99 String lang() const; |
101 String body() const; | 100 String body() const; |
102 String tag() const; | 101 String tag() const; |
103 String image() const; | 102 String image() const; |
104 String icon() const; | 103 String icon() const; |
105 String badge() const; | 104 String badge() const; |
106 NavigatorVibration::VibrationPattern vibrate() const; | 105 NavigatorVibration::VibrationPattern vibrate() const; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Shows the notification through the embedder using the loaded resources. | 167 // Shows the notification through the embedder using the loaded resources. |
169 void didLoadResources(NotificationResourcesLoader*); | 168 void didLoadResources(NotificationResourcesLoader*); |
170 | 169 |
171 Type m_type; | 170 Type m_type; |
172 State m_state; | 171 State m_state; |
173 | 172 |
174 WebNotificationData m_data; | 173 WebNotificationData m_data; |
175 | 174 |
176 String m_notificationId; | 175 String m_notificationId; |
177 | 176 |
| 177 // Whether the developer has requested the notification to be closed whilst |
| 178 // it's still in process of being shown. |
| 179 bool m_requestedClose; |
| 180 |
178 Member<AsyncMethodRunner<Notification>> m_prepareShowMethodRunner; | 181 Member<AsyncMethodRunner<Notification>> m_prepareShowMethodRunner; |
179 | 182 |
180 Member<NotificationResourcesLoader> m_loader; | 183 Member<NotificationResourcesLoader> m_loader; |
181 }; | 184 }; |
182 | 185 |
183 } // namespace blink | 186 } // namespace blink |
184 | 187 |
185 #endif // Notification_h | 188 #endif // Notification_h |
OLD | NEW |