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

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

Issue 960163003: Add the "silent" property to the NotificationOptions dictionary. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/notifications/Notification.h ('k') | Source/modules/notifications/Notification.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 1abf386bb94d981889ee870479f97f4afc258ffb..0a8cf69dae08118ca53c7ea87a16e0f59bf85c07 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -78,6 +78,7 @@ Notification* Notification::create(ExecutionContext* context, const String& titl
notification->setTag(options.tag());
notification->setLang(options.lang());
notification->setDir(options.dir());
+ notification->setSilent(options.silent());
if (options.hasIcon()) {
KURL iconUrl = options.icon().isEmpty() ? KURL() : context->completeURL(options.icon());
if (!iconUrl.isEmpty() && iconUrl.isValid())
@@ -103,6 +104,7 @@ Notification* Notification::create(ExecutionContext* context, const String& pers
notification->setLang(data.lang);
notification->setBody(data.body);
notification->setTag(data.tag);
+ notification->setSilent(data.silent);
if (!data.icon.isEmpty())
notification->setIconUrl(data.icon);
@@ -116,6 +118,7 @@ Notification::Notification(const String& title, ExecutionContext* context)
: ActiveDOMObject(context)
, m_title(title)
, m_dir("auto")
+ , m_silent(false)
, m_state(NotificationStateIdle)
, m_asyncRunner(this, &Notification::show)
{
@@ -147,7 +150,7 @@ void Notification::show()
// FIXME: Do CSP checks on the associated notification icon.
WebNotificationData::Direction dir = m_dir == "rtl" ? WebNotificationData::DirectionRightToLeft : WebNotificationData::DirectionLeftToRight;
- WebNotificationData notificationData(m_title, dir, m_lang, m_body, m_tag, m_iconUrl);
+ WebNotificationData notificationData(m_title, dir, m_lang, m_body, m_tag, m_iconUrl, m_silent);
notificationManager()->show(WebSerializedOrigin(*origin), notificationData, this);
m_state = NotificationStateShowing;
« no previous file with comments | « Source/modules/notifications/Notification.h ('k') | Source/modules/notifications/Notification.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698