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

Side by Side Diff: Source/modules/notifications/ServiceWorkerRegistrationNotifications.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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h" 6 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h"
7 7
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" 8 #include "bindings/core/v8/CallbackPromiseAdapter.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/V8ThrowException.h" 10 #include "bindings/core/v8/V8ThrowException.h"
(...skipping 28 matching lines...) Expand all
39 // FIXME: Do the appropriate CORS checks on the icon URL. 39 // FIXME: Do the appropriate CORS checks on the icon URL.
40 40
41 KURL iconUrl; 41 KURL iconUrl;
42 if (options.hasIcon() && !options.icon().isEmpty()) { 42 if (options.hasIcon() && !options.icon().isEmpty()) {
43 iconUrl = executionContext->completeURL(options.icon()); 43 iconUrl = executionContext->completeURL(options.icon());
44 if (!iconUrl.isValid()) 44 if (!iconUrl.isValid())
45 iconUrl = KURL(); 45 iconUrl = KURL();
46 } 46 }
47 47
48 WebNotificationData::Direction dir = options.dir() == "rtl" ? WebNotificatio nData::DirectionRightToLeft : WebNotificationData::DirectionLeftToRight; 48 WebNotificationData::Direction dir = options.dir() == "rtl" ? WebNotificatio nData::DirectionRightToLeft : WebNotificationData::DirectionLeftToRight;
49 WebNotificationData notification(title, dir, options.lang(), options.body(), options.tag(), iconUrl); 49 WebNotificationData notification(title, dir, options.lang(), options.body(), options.tag(), iconUrl, options.silent());
50 WebNotificationShowCallbacks* callbacks = new CallbackPromiseAdapter<void, v oid>(resolver); 50 WebNotificationShowCallbacks* callbacks = new CallbackPromiseAdapter<void, v oid>(resolver);
51 51
52 SecurityOrigin* origin = executionContext->securityOrigin(); 52 SecurityOrigin* origin = executionContext->securityOrigin();
53 ASSERT(origin); 53 ASSERT(origin);
54 54
55 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager(); 55 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager();
56 ASSERT(notificationManager); 56 ASSERT(notificationManager);
57 57
58 notificationManager->showPersistent(WebSerializedOrigin(*origin), notificati on, serviceWorkerRegistration.webRegistration(), callbacks); 58 notificationManager->showPersistent(WebSerializedOrigin(*origin), notificati on, serviceWorkerRegistration.webRegistration(), callbacks);
59 return promise; 59 return promise;
60 } 60 }
61 61
62 } // namespace blink 62 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/notifications/NotificationOptions.idl ('k') | public/platform/modules/notifications/WebNotificationData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698