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

Unified Diff: Source/modules/notifications/Notification.h

Issue 1042513002: Add the vibrate attribute to the Notification object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WebNotificationVibrationData is renamed WebNotificationVibratePattern Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/notifications/Notification.h
diff --git a/Source/modules/notifications/Notification.h b/Source/modules/notifications/Notification.h
index 1f780a0a9bfdd265eb3e0c2c89bc3e0ed2ae1cb6..9494d697f6df696bdc67177ab7647ec63c2f4ff8 100644
--- a/Source/modules/notifications/Notification.h
+++ b/Source/modules/notifications/Notification.h
@@ -32,6 +32,7 @@
#define Notification_h
#include "bindings/core/v8/SerializedScriptValue.h"
+#include "bindings/modules/v8/UnionTypesModules.h"
#include "core/dom/ActiveDOMObject.h"
#include "modules/EventTargetModules.h"
#include "platform/AsyncMethodRunner.h"
@@ -53,6 +54,7 @@ class NotificationPermissionCallback;
class ScriptState;
class ScriptValue;
struct WebNotificationData;
+struct WebNotificationVibratePattern;
class Notification final : public RefCountedGarbageCollectedEventTargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificationDelegate {
DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<Notification>);
@@ -87,6 +89,7 @@ public:
String body() const { return m_body; }
String tag() const { return m_tag; }
String icon() const { return m_iconUrl; }
+ void vibrate(UnsignedLongOrUnsignedLongSequence&);
bool silent() const { return m_silent; }
ScriptValue data(ScriptState*) const;
@@ -98,6 +101,7 @@ public:
static String permission(ExecutionContext*);
static WebNotificationPermission checkPermission(ExecutionContext*);
static void requestPermission(ExecutionContext*, NotificationPermissionCallback* = nullptr);
+ static WebNotificationVibratePattern convertFromVibrationData(const UnsignedLongOrUnsignedLongSequence&);
// EventTarget interface.
virtual ExecutionContext* executionContext() const override final { return ActiveDOMObject::executionContext(); }
@@ -127,6 +131,7 @@ private:
void setBody(const String& body) { m_body = body; }
void setIconUrl(KURL iconUrl) { m_iconUrl = iconUrl; }
void setTag(const String& tag) { m_tag = tag; }
+ void setVibrate(const UnsignedLongOrUnsignedLongSequence& vibrate) { m_vibrate = vibrate; }
void setSilent(bool silent) { m_silent = silent; }
void setSerializedData(PassRefPtr<SerializedScriptValue> data) { m_serializedData = data; }
@@ -138,6 +143,7 @@ private:
String m_lang;
String m_body;
String m_tag;
+ UnsignedLongOrUnsignedLongSequence m_vibrate;
bool m_silent;
RefPtr<SerializedScriptValue> m_serializedData;

Powered by Google App Engine
This is Rietveld 408576698