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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 | 58 |
59 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent TargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificati onDelegate { | 59 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent TargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificati onDelegate { |
60 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); | 60 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); |
61 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification); | 61 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification); |
62 DEFINE_WRAPPERTYPEINFO(); | 62 DEFINE_WRAPPERTYPEINFO(); |
63 public: | 63 public: |
64 // Used for JavaScript instantiations of the Notification object. Will autom atically schedule for | 64 // Used for JavaScript instantiations of the Notification object. Will autom atically schedule for |
65 // the notification to be displayed to the user when the developer-provided data is valid. | 65 // the notification to be displayed to the user when the developer-provided data is valid. |
66 static Notification* create(ExecutionContext*, const String& title, const No tificationOptions&, ExceptionState&); | 66 static Notification* create(ExecutionContext*, const String& title, const No tificationOptions&, ExceptionState&); |
67 | 67 |
68 // Used for embedder-created Notification objects. Will initialize the Notif ication's state as showing. | 68 // Used for embedder-created Notification objects. If |showing| is true, wil l initialize the |
69 static Notification* create(ExecutionContext*, int64_t persistentId, const W ebNotificationData&); | 69 // Notification's state as showing, or as closing otherwise. |
Peter Beverloo
2016/01/26 16:13:45
closing? I think we should initialize it as Notifi
Nina
2016/01/27 18:48:58
Makes sense. Fixed.
| |
70 static Notification* create(ExecutionContext*, int64_t persistentId, const W ebNotificationData&, bool showing); | |
70 | 71 |
71 ~Notification() override; | 72 ~Notification() override; |
72 | 73 |
73 void close(); | 74 void close(); |
74 | 75 |
75 DEFINE_ATTRIBUTE_EVENT_LISTENER(click); | 76 DEFINE_ATTRIBUTE_EVENT_LISTENER(click); |
76 DEFINE_ATTRIBUTE_EVENT_LISTENER(show); | 77 DEFINE_ATTRIBUTE_EVENT_LISTENER(show); |
77 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 78 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
78 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
79 | 80 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 void setState(NotificationState state) { m_state = state; } | 153 void setState(NotificationState state) { m_state = state; } |
153 | 154 |
154 NotificationState m_state; | 155 NotificationState m_state; |
155 | 156 |
156 Member<AsyncMethodRunner<Notification>> m_asyncRunner; | 157 Member<AsyncMethodRunner<Notification>> m_asyncRunner; |
157 }; | 158 }; |
158 | 159 |
159 } // namespace blink | 160 } // namespace blink |
160 | 161 |
161 #endif // Notification_h | 162 #endif // Notification_h |
OLD | NEW |