| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "public/platform/modules/permissions/permission_status.mojom.h" | 49 #include "public/platform/modules/permissions/permission_status.mojom.h" |
| 50 | 50 |
| 51 namespace blink { | 51 namespace blink { |
| 52 | 52 |
| 53 class ExecutionContext; | 53 class ExecutionContext; |
| 54 class NotificationAction; | 54 class NotificationAction; |
| 55 class NotificationOptions; | 55 class NotificationOptions; |
| 56 class NotificationPermissionCallback; | 56 class NotificationPermissionCallback; |
| 57 class NotificationResourcesLoader; | 57 class NotificationResourcesLoader; |
| 58 class ScriptState; | 58 class ScriptState; |
| 59 class V8NotificationAction; |
| 59 | 60 |
| 60 class MODULES_EXPORT Notification final : public EventTargetWithInlineData, publ
ic ActiveScriptWrappable, public ActiveDOMObject, public WebNotificationDelegate
{ | 61 class MODULES_EXPORT Notification final : public EventTargetWithInlineData, publ
ic ActiveScriptWrappable, public ActiveDOMObject, public WebNotificationDelegate
{ |
| 61 USING_GARBAGE_COLLECTED_MIXIN(Notification); | 62 USING_GARBAGE_COLLECTED_MIXIN(Notification); |
| 62 DEFINE_WRAPPERTYPEINFO(); | 63 DEFINE_WRAPPERTYPEINFO(); |
| 63 public: | 64 public: |
| 64 // 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 |
| 65 // 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. |
| 66 static Notification* create(ExecutionContext*, const String& title, const No
tificationOptions&, ExceptionState&); | 67 static Notification* create(ExecutionContext*, const String& title, const No
tificationOptions&, ExceptionState&); |
| 67 | 68 |
| 68 // Used for embedder-created Notification objects. If |showing| is true, wil
l initialize the | 69 // Used for embedder-created Notification objects. If |showing| is true, wil
l initialize the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 84 void dispatchErrorEvent() override; | 85 void dispatchErrorEvent() override; |
| 85 void dispatchCloseEvent() override; | 86 void dispatchCloseEvent() override; |
| 86 | 87 |
| 87 String title() const; | 88 String title() const; |
| 88 String dir() const; | 89 String dir() const; |
| 89 String lang() const; | 90 String lang() const; |
| 90 String body() const; | 91 String body() const; |
| 91 String tag() const; | 92 String tag() const; |
| 92 String icon() const; | 93 String icon() const; |
| 93 String badge() const; | 94 String badge() const; |
| 94 NavigatorVibration::VibrationPattern vibrate(bool& isNull) const; | 95 NavigatorVibration::VibrationPattern vibrate() const; |
| 95 DOMTimeStamp timestamp() const; | 96 DOMTimeStamp timestamp() const; |
| 96 bool renotify() const; | 97 bool renotify() const; |
| 97 bool silent() const; | 98 bool silent() const; |
| 98 bool requireInteraction() const; | 99 bool requireInteraction() const; |
| 99 ScriptValue data(ScriptState*); | 100 ScriptValue data(ScriptState*); |
| 100 HeapVector<NotificationAction> actions() const; | 101 Vector<v8::Local<v8::Value>> actions(ScriptState*) const; |
| 101 | 102 |
| 102 static String permissionString(mojom::PermissionStatus); | 103 static String permissionString(mojom::PermissionStatus); |
| 103 static String permission(ExecutionContext*); | 104 static String permission(ExecutionContext*); |
| 104 static mojom::PermissionStatus checkPermission(ExecutionContext*); | 105 static mojom::PermissionStatus checkPermission(ExecutionContext*); |
| 105 static ScriptPromise requestPermission(ScriptState*, NotificationPermissionC
allback*); | 106 static ScriptPromise requestPermission(ScriptState*, NotificationPermissionC
allback*); |
| 106 | 107 |
| 107 static size_t maxActions(); | 108 static size_t maxActions(); |
| 108 | 109 |
| 109 // EventTarget interface. | 110 // EventTarget interface. |
| 110 ExecutionContext* getExecutionContext() const final { return ActiveDOMObject
::getExecutionContext(); } | 111 ExecutionContext* getExecutionContext() const final { return ActiveDOMObject
::getExecutionContext(); } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 NotificationState m_state; | 164 NotificationState m_state; |
| 164 | 165 |
| 165 Member<AsyncMethodRunner<Notification>> m_prepareShowMethodRunner; | 166 Member<AsyncMethodRunner<Notification>> m_prepareShowMethodRunner; |
| 166 | 167 |
| 167 Member<NotificationResourcesLoader> m_loader; | 168 Member<NotificationResourcesLoader> m_loader; |
| 168 }; | 169 }; |
| 169 | 170 |
| 170 } // namespace blink | 171 } // namespace blink |
| 171 | 172 |
| 172 #endif // Notification_h | 173 #endif // Notification_h |
| OLD | NEW |