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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef Notification_h | 31 #ifndef Notification_h |
32 #define Notification_h | 32 #define Notification_h |
33 | 33 |
34 #include "bindings/core/v8/ScriptPromise.h" | 34 #include "bindings/core/v8/ScriptPromise.h" |
35 #include "bindings/core/v8/ScriptValue.h" | 35 #include "bindings/core/v8/ScriptValue.h" |
36 #include "bindings/core/v8/SerializedScriptValue.h" | 36 #include "bindings/core/v8/SerializedScriptValue.h" |
| 37 #include "bindings/core/v8/V8GCRoot.h" |
37 #include "core/dom/ActiveDOMObject.h" | 38 #include "core/dom/ActiveDOMObject.h" |
38 #include "core/dom/DOMTimeStamp.h" | 39 #include "core/dom/DOMTimeStamp.h" |
39 #include "modules/EventTargetModules.h" | 40 #include "modules/EventTargetModules.h" |
40 #include "modules/ModulesExport.h" | 41 #include "modules/ModulesExport.h" |
41 #include "modules/vibration/NavigatorVibration.h" | 42 #include "modules/vibration/NavigatorVibration.h" |
42 #include "platform/AsyncMethodRunner.h" | 43 #include "platform/AsyncMethodRunner.h" |
43 #include "platform/heap/Handle.h" | 44 #include "platform/heap/Handle.h" |
44 #include "platform/weborigin/KURL.h" | 45 #include "platform/weborigin/KURL.h" |
45 #include "public/platform/WebVector.h" | 46 #include "public/platform/WebVector.h" |
46 #include "public/platform/modules/notifications/WebNotificationData.h" | 47 #include "public/platform/modules/notifications/WebNotificationData.h" |
47 #include "public/platform/modules/notifications/WebNotificationDelegate.h" | 48 #include "public/platform/modules/notifications/WebNotificationDelegate.h" |
48 #include "public/platform/modules/notifications/WebNotificationPermission.h" | 49 #include "public/platform/modules/notifications/WebNotificationPermission.h" |
49 #include "wtf/PassRefPtr.h" | 50 #include "wtf/PassRefPtr.h" |
50 #include "wtf/RefCounted.h" | 51 #include "wtf/RefCounted.h" |
51 | 52 |
52 namespace blink { | 53 namespace blink { |
53 | 54 |
54 class ExecutionContext; | 55 class ExecutionContext; |
55 class NotificationAction; | 56 class NotificationAction; |
56 class NotificationOptions; | 57 class NotificationOptions; |
57 class NotificationPermissionCallback; | 58 class NotificationPermissionCallback; |
58 class ScriptState; | 59 class ScriptState; |
59 | 60 |
60 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent
TargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificati
onDelegate { | 61 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent
TargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificati
onDelegate, public V8GCRoot { |
61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); | 62 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); |
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification); | 63 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification); |
63 DEFINE_WRAPPERTYPEINFO(); | 64 DEFINE_WRAPPERTYPEINFO(); |
64 public: | 65 public: |
65 // Used for JavaScript instantiations of the Notification object. Will autom
atically schedule for | 66 // Used for JavaScript instantiations of the Notification object. Will autom
atically schedule for |
66 // the notification to be displayed to the user when the developer-provided
data is valid. | 67 // the notification to be displayed to the user when the developer-provided
data is valid. |
67 static Notification* create(ExecutionContext*, const String& title, const No
tificationOptions&, ExceptionState&); | 68 static Notification* create(ExecutionContext*, const String& title, const No
tificationOptions&, ExceptionState&); |
68 | 69 |
69 // Used for embedder-created Notification objects. If |showing| is true, wil
l initialize the | 70 // Used for embedder-created Notification objects. If |showing| is true, wil
l initialize the |
70 // Notification's state as showing, or as closed otherwise. | 71 // Notification's state as showing, or as closed otherwise. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 void setState(NotificationState state) { m_state = state; } | 157 void setState(NotificationState state) { m_state = state; } |
157 | 158 |
158 NotificationState m_state; | 159 NotificationState m_state; |
159 | 160 |
160 Member<AsyncMethodRunner<Notification>> m_asyncRunner; | 161 Member<AsyncMethodRunner<Notification>> m_asyncRunner; |
161 }; | 162 }; |
162 | 163 |
163 } // namespace blink | 164 } // namespace blink |
164 | 165 |
165 #endif // Notification_h | 166 #endif // Notification_h |
OLD | NEW |