OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 #ifndef Notification_h | 32 #ifndef Notification_h |
33 #define Notification_h | 33 #define Notification_h |
34 | 34 |
35 #include "bindings/v8/ScriptWrappable.h" | 35 #include "bindings/v8/ScriptWrappable.h" |
36 #include "core/dom/ActiveDOMObject.h" | 36 #include "core/dom/ActiveDOMObject.h" |
37 #include "core/events/EventTarget.h" | 37 #include "core/events/EventTarget.h" |
38 #include "core/events/ThreadLocalEventNames.h" | 38 #include "core/events/ThreadLocalEventNames.h" |
39 #include "core/loader/ThreadableLoaderClient.h" | 39 #include "core/loader/ThreadableLoaderClient.h" |
40 #include "modules/notifications/NotificationClient.h" | 40 #include "modules/notifications/NotificationClient.h" |
| 41 #include "platform/AsyncMethodRunner.h" |
41 #include "platform/SharedBuffer.h" | 42 #include "platform/SharedBuffer.h" |
42 #include "platform/Timer.h" | |
43 #include "platform/text/TextDirection.h" | 43 #include "platform/text/TextDirection.h" |
44 #include "weborigin/KURL.h" | 44 #include "weborigin/KURL.h" |
45 #include "wtf/OwnPtr.h" | 45 #include "wtf/OwnPtr.h" |
46 #include "wtf/PassRefPtr.h" | 46 #include "wtf/PassRefPtr.h" |
47 #include "wtf/RefCounted.h" | 47 #include "wtf/RefCounted.h" |
48 #include "wtf/RefPtr.h" | 48 #include "wtf/RefPtr.h" |
49 #include "wtf/text/AtomicStringHash.h" | 49 #include "wtf/text/AtomicStringHash.h" |
50 | 50 |
51 namespace WebCore { | 51 namespace WebCore { |
52 | 52 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 #if ENABLE(LEGACY_NOTIFICATIONS) | 135 #if ENABLE(LEGACY_NOTIFICATIONS) |
136 Notification(const String& title, const String& body, const String& iconURI,
ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter>); | 136 Notification(const String& title, const String& body, const String& iconURI,
ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter>); |
137 #endif | 137 #endif |
138 Notification(ExecutionContext*, const String& title); | 138 Notification(ExecutionContext*, const String& title); |
139 | 139 |
140 void setBody(const String& body) { m_body = body; } | 140 void setBody(const String& body) { m_body = body; } |
141 | 141 |
142 void startLoadingIcon(); | 142 void startLoadingIcon(); |
143 void finishLoadingIcon(); | 143 void finishLoadingIcon(); |
144 | 144 |
145 void taskTimerFired(Timer<Notification>*); | 145 void showSoon(); |
146 | 146 |
147 // Text notifications. | 147 // Text notifications. |
148 KURL m_icon; | 148 KURL m_icon; |
149 String m_title; | 149 String m_title; |
150 String m_body; | 150 String m_body; |
151 | 151 |
152 String m_direction; | 152 String m_direction; |
153 String m_lang; | 153 String m_lang; |
154 String m_tag; | 154 String m_tag; |
155 | 155 |
156 enum NotificationState { | 156 enum NotificationState { |
157 Idle = 0, | 157 Idle = 0, |
158 Showing = 1, | 158 Showing = 1, |
159 Closed = 2, | 159 Closed = 2, |
160 }; | 160 }; |
161 | 161 |
162 NotificationState m_state; | 162 NotificationState m_state; |
163 | 163 |
164 NotificationClient* m_notificationClient; | 164 NotificationClient* m_notificationClient; |
165 | 165 |
166 OwnPtr<Timer<Notification> > m_taskTimer; | 166 OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner; |
167 }; | 167 }; |
168 | 168 |
169 } // namespace WebCore | 169 } // namespace WebCore |
170 | 170 |
171 #endif // Notifications_h | 171 #endif // Notifications_h |
OLD | NEW |