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

Unified Diff: content/renderer/push_messaging/push_messaging_dispatcher.cc

Issue 1316973002: Pass WebPushError::ErrorTypePermissionDenied when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/child/push_messaging/push_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/push_messaging/push_messaging_dispatcher.cc
diff --git a/content/renderer/push_messaging/push_messaging_dispatcher.cc b/content/renderer/push_messaging/push_messaging_dispatcher.cc
index f82547e43292b720ec369c3a0b199d713cb50e3f..dcf79de570821ca8be67a245857ce98efa6aa3c0 100644
--- a/content/renderer/push_messaging/push_messaging_dispatcher.cc
+++ b/content/renderer/push_messaging/push_messaging_dispatcher.cc
@@ -103,8 +103,13 @@ void PushMessagingDispatcher::OnSubscribeFromDocumentError(
subscription_callbacks_.Lookup(request_id);
DCHECK(callbacks);
+ blink::WebPushError::ErrorType error_type =
+ status == PUSH_REGISTRATION_STATUS_PERMISSION_DENIED
+ ? blink::WebPushError::ErrorTypePermissionDenied
+ : blink::WebPushError::ErrorTypeAbort;
+
callbacks->onError(blink::WebPushError(
- blink::WebPushError::ErrorTypeAbort,
+ error_type,
blink::WebString::fromUTF8(PushRegistrationStatusToString(status))));
subscription_callbacks_.Remove(request_id);
« no previous file with comments | « content/child/push_messaging/push_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698