Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: third_party/WebKit/Source/modules/notifications/Notification.h

Issue 1619703002: Implement notificationclose event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent TargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificati onDelegate { 60 class MODULES_EXPORT Notification final : public RefCountedGarbageCollectedEvent TargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificati onDelegate {
61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification); 61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Notification);
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification); 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification);
63 DEFINE_WRAPPERTYPEINFO(); 63 DEFINE_WRAPPERTYPEINFO();
64 public: 64 public:
65 // Used for JavaScript instantiations of the Notification object. Will autom atically schedule for 65 // 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. 66 // 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&); 67 static Notification* create(ExecutionContext*, const String& title, const No tificationOptions&, ExceptionState&);
68 68
69 // Used for embedder-created Notification objects. Will initialize the Notif ication's state as showing. 69 // Used for embedder-created Notification objects. If |showing| is true, wil l initialize the
70 static Notification* create(ExecutionContext*, int64_t persistentId, const W ebNotificationData&); 70 // Notification's state as showing, or as closed otherwise.
71 static Notification* create(ExecutionContext*, int64_t persistentId, const W ebNotificationData&, bool showing);
71 72
72 ~Notification() override; 73 ~Notification() override;
73 74
74 void close(); 75 void close();
75 76
76 DEFINE_ATTRIBUTE_EVENT_LISTENER(click); 77 DEFINE_ATTRIBUTE_EVENT_LISTENER(click);
77 DEFINE_ATTRIBUTE_EVENT_LISTENER(show); 78 DEFINE_ATTRIBUTE_EVENT_LISTENER(show);
78 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
79 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
80 81
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void setState(NotificationState state) { m_state = state; } 155 void setState(NotificationState state) { m_state = state; }
155 156
156 NotificationState m_state; 157 NotificationState m_state;
157 158
158 Member<AsyncMethodRunner<Notification>> m_asyncRunner; 159 Member<AsyncMethodRunner<Notification>> m_asyncRunner;
159 }; 160 };
160 161
161 } // namespace blink 162 } // namespace blink
162 163
163 #endif // Notification_h 164 #endif // Notification_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698