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

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

Issue 1259193003: Add priority to Notification & NotificationOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@actions3
Patch Set: Lowest to highest enum order Created 5 years, 4 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 31735bfc09638301e01ed1731ef34223e6263b7f..2ada9429b19a25d506e4a7f53a38100395139dc9 100644
--- a/Source/modules/notifications/Notification.h
+++ b/Source/modules/notifications/Notification.h
@@ -44,6 +44,7 @@
#include "platform/weborigin/KURL.h"
#include "public/platform/WebVector.h"
#include "public/platform/modules/notifications/WebNotificationAction.h"
+#include "public/platform/modules/notifications/WebNotificationData.h"
#include "public/platform/modules/notifications/WebNotificationDelegate.h"
#include "public/platform/modules/notifications/WebNotificationPermission.h"
#include "wtf/PassOwnPtr.h"
@@ -93,6 +94,7 @@ public:
String lang() const { return m_lang; }
String body() const { return m_body; }
String tag() const { return m_tag; }
+ String priority() const { return m_priority; }
String icon() const { return m_iconUrl; }
const NavigatorVibration::VibrationPattern& vibrate(bool& isNull) const;
bool silent() const { return m_silent; }
@@ -108,6 +110,8 @@ public:
static WebNotificationPermission checkPermission(ExecutionContext*);
static ScriptPromise requestPermission(ScriptState*, NotificationPermissionCallback*);
+ static WebNotificationData::Priority priorityEnum(const String& priority);
+
static size_t maxActions();
static void actionsToWebActions(const HeapVector<NotificationAction>& actions, WebVector<WebNotificationAction>* webActions);
@@ -127,6 +131,8 @@ protected:
bool dispatchEventInternal(PassRefPtrWillBeRawPtr<Event>) final;
private:
+ static String priorityString(WebNotificationData::Priority);
+
static void webActionsToActions(const WebVector<WebNotificationAction>& webActions, HeapVector<NotificationAction>* actions);
Notification(const String& title, ExecutionContext*);
@@ -145,6 +151,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 setPriority(const String& priority) { m_priority = priority; }
void setVibrate(const NavigatorVibration::VibrationPattern& vibrate) { m_vibrate = vibrate; }
void setSilent(bool silent) { m_silent = silent; }
void setSerializedData(PassRefPtr<SerializedScriptValue> data) { m_serializedData = data; }
@@ -157,6 +164,7 @@ private:
String m_lang;
String m_body;
String m_tag;
+ String m_priority;
Peter Beverloo 2015/08/03 16:41:59 I don't like having enum values stored as strings.
johnme 2015/08/03 16:58:48 Acknowledged.
NavigatorVibration::VibrationPattern m_vibrate;
bool m_silent;
RefPtr<SerializedScriptValue> m_serializedData;

Powered by Google App Engine
This is Rietveld 408576698