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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 KURL iconURL() const { return m_iconUrl; } | 98 KURL iconURL() const { return m_iconUrl; } |
99 SerializedScriptValue* serializedData() const { return m_serializedData.get(
); } | 99 SerializedScriptValue* serializedData() const { return m_serializedData.get(
); } |
100 | 100 |
101 static String permissionString(WebNotificationPermission); | 101 static String permissionString(WebNotificationPermission); |
102 static String permission(ExecutionContext*); | 102 static String permission(ExecutionContext*); |
103 static WebNotificationPermission checkPermission(ExecutionContext*); | 103 static WebNotificationPermission checkPermission(ExecutionContext*); |
104 static void requestPermission(ExecutionContext*, NotificationPermissionCallb
ack* = nullptr); | 104 static void requestPermission(ExecutionContext*, NotificationPermissionCallb
ack* = nullptr); |
105 | 105 |
106 // EventTarget interface. | 106 // EventTarget interface. |
107 ExecutionContext* executionContext() const final { return ActiveDOMObject::e
xecutionContext(); } | 107 ExecutionContext* executionContext() const final { return ActiveDOMObject::e
xecutionContext(); } |
108 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) final; | |
109 const AtomicString& interfaceName() const override; | 108 const AtomicString& interfaceName() const override; |
110 | 109 |
111 // ActiveDOMObject interface. | 110 // ActiveDOMObject interface. |
112 void stop() override; | 111 void stop() override; |
113 bool hasPendingActivity() const override; | 112 bool hasPendingActivity() const override; |
114 | 113 |
115 DECLARE_VIRTUAL_TRACE(); | 114 DECLARE_VIRTUAL_TRACE(); |
116 | 115 |
| 116 protected: |
| 117 bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) final; |
| 118 |
117 private: | 119 private: |
118 Notification(const String& title, ExecutionContext*); | 120 Notification(const String& title, ExecutionContext*); |
119 | 121 |
120 void scheduleShow(); | 122 void scheduleShow(); |
121 | 123 |
122 // Calling show() may start asynchronous operation. If this object has | 124 // Calling show() may start asynchronous operation. If this object has |
123 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being | 125 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being |
124 // collected while m_state is Showing, and so this instance stays alive | 126 // collected while m_state is Showing, and so this instance stays alive |
125 // until the operation completes. Otherwise, you need to hold a ref on this | 127 // until the operation completes. Otherwise, you need to hold a ref on this |
126 // instance until the operation completes. | 128 // instance until the operation completes. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void setState(NotificationState state) { m_state = state; } | 168 void setState(NotificationState state) { m_state = state; } |
167 | 169 |
168 NotificationState m_state; | 170 NotificationState m_state; |
169 | 171 |
170 AsyncMethodRunner<Notification> m_asyncRunner; | 172 AsyncMethodRunner<Notification> m_asyncRunner; |
171 }; | 173 }; |
172 | 174 |
173 } // namespace blink | 175 } // namespace blink |
174 | 176 |
175 #endif // Notification_h | 177 #endif // Notification_h |
OLD | NEW |