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

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

Issue 393863002: Switch Blink to the new Web Notifications permission path. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 5 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.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 78935834f83fb4ba6c14892e13da8eff0ae150c5..8bbeb9d320d82b3b4386bf8048b228af2bcb4012 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -39,6 +39,7 @@
#include "core/page/WindowFocusAllowedIndicator.h"
#include "modules/notifications/NotificationClient.h"
#include "modules/notifications/NotificationController.h"
+#include "modules/notifications/NotificationPermissionClient.h"
namespace blink {
@@ -168,8 +169,15 @@ const String& Notification::permission(ExecutionContext* context)
void Notification::requestPermission(ExecutionContext* context, PassOwnPtr<NotificationPermissionCallback> callback)
{
- ASSERT(toDocument(context)->page());
- NotificationController::clientFrom(context).requestPermission(context, callback);
+ NotificationPermissionClient* permissionClient = NotificationPermissionClient::from(context);
+ if (permissionClient) {
abarth-chromium 2014/07/29 16:52:29 You can merge these two lines.
Peter Beverloo 2014/07/30 11:22:55 Done.
+ permissionClient->requestPermission(context, callback);
+ return;
+ }
+
+ // FIXME: What is the intended behavior for Notification.requestPermission when called
+ // from a Worker context? Should it be a no-op, or should |callback| be invoked with
+ // the current permission level?
Peter Beverloo 2014/07/28 17:03:16 note: I've sent an e-mail to the WHATWG list to cl
}
bool Notification::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
« no previous file with comments | « LayoutTests/fast/notifications/notifications-permission-values.html ('k') | Source/modules/notifications/NotificationClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698