| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 namespace blink { | 53 namespace blink { |
| 54 | 54 |
| 55 class ExecutionContext; | 55 class ExecutionContext; |
| 56 class NotificationAction; | 56 class NotificationAction; |
| 57 class NotificationOptions; | 57 class NotificationOptions; |
| 58 class NotificationPermissionCallback; | 58 class NotificationPermissionCallback; |
| 59 class ScriptState; | 59 class ScriptState; |
| 60 | 60 |
| 61 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent
TargetWithInlineData<Notification>, public ActiveScriptWrappable, public ActiveD
OMObject, public WebNotificationDelegate { | 61 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent
TargetWithInlineData<Notification>, public ActiveScriptWrappable, public ActiveD
OMObject, public WebNotificationDelegate { |
| 62 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); | 62 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); |
| 63 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification); | 63 USING_GARBAGE_COLLECTED_MIXIN(Notification); |
| 64 DEFINE_WRAPPERTYPEINFO(); | 64 DEFINE_WRAPPERTYPEINFO(); |
| 65 public: | 65 public: |
| 66 // 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 |
| 67 // 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. |
| 68 static Notification* create(ExecutionContext*, const String& title, const No
tificationOptions&, ExceptionState&); | 68 static Notification* create(ExecutionContext*, const String& title, const No
tificationOptions&, ExceptionState&); |
| 69 | 69 |
| 70 // 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 |
| 71 // Notification's state as showing, or as closed otherwise. | 71 // Notification's state as showing, or as closed otherwise. |
| 72 static Notification* create(ExecutionContext*, int64_t persistentId, const W
ebNotificationData&, bool showing); | 72 static Notification* create(ExecutionContext*, int64_t persistentId, const W
ebNotificationData&, bool showing); |
| 73 | 73 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // ActiveDOMObject interface. | 115 // ActiveDOMObject interface. |
| 116 void stop() override; | 116 void stop() override; |
| 117 | 117 |
| 118 // ActiveScriptWrappable interface. | 118 // ActiveScriptWrappable interface. |
| 119 bool hasPendingActivity() const final; | 119 bool hasPendingActivity() const final; |
| 120 | 120 |
| 121 DECLARE_VIRTUAL_TRACE(); | 121 DECLARE_VIRTUAL_TRACE(); |
| 122 | 122 |
| 123 protected: | 123 protected: |
| 124 // EventTarget interface. | 124 // EventTarget interface. |
| 125 DispatchEventResult dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) fin
al; | 125 DispatchEventResult dispatchEventInternal(RawPtr<Event>) final; |
| 126 | 126 |
| 127 private: | 127 private: |
| 128 Notification(ExecutionContext*, const WebNotificationData&); | 128 Notification(ExecutionContext*, const WebNotificationData&); |
| 129 | 129 |
| 130 void scheduleShow(); | 130 void scheduleShow(); |
| 131 | 131 |
| 132 // Calling show() may start asynchronous operation. If this object has | 132 // Calling show() may start asynchronous operation. If this object has |
| 133 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being | 133 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being |
| 134 // collected while m_state is Showing, and so this instance stays alive | 134 // collected while m_state is Showing, and so this instance stays alive |
| 135 // until the operation completes. Otherwise, you need to hold a ref on this | 135 // until the operation completes. Otherwise, you need to hold a ref on this |
| (...skipping 24 matching lines...) Expand all Loading... |
| 160 void setState(NotificationState state) { m_state = state; } | 160 void setState(NotificationState state) { m_state = state; } |
| 161 | 161 |
| 162 NotificationState m_state; | 162 NotificationState m_state; |
| 163 | 163 |
| 164 Member<AsyncMethodRunner<Notification>> m_asyncRunner; | 164 Member<AsyncMethodRunner<Notification>> m_asyncRunner; |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 } // namespace blink | 167 } // namespace blink |
| 168 | 168 |
| 169 #endif // Notification_h | 169 #endif // Notification_h |
| OLD | NEW |