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

Side by Side Diff: content/renderer/push_messaging/push_messaging_dispatcher.cc

Issue 2199213003: Use NotAllowedError instead of PermissionDeniedError for the Push API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the browser tests Created 4 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 unified diff | Download patch
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 "content/renderer/push_messaging/push_messaging_dispatcher.h" 5 #include "content/renderer/push_messaging/push_messaging_dispatcher.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/child/service_worker/web_service_worker_registration_impl.h" 9 #include "content/child/service_worker/web_service_worker_registration_impl.h"
10 #include "content/common/push_messaging_messages.h" 10 #include "content/common/push_messaging_messages.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 void PushMessagingDispatcher::OnSubscribeFromDocumentError( 132 void PushMessagingDispatcher::OnSubscribeFromDocumentError(
133 int32_t request_id, 133 int32_t request_id,
134 PushRegistrationStatus status) { 134 PushRegistrationStatus status) {
135 blink::WebPushSubscriptionCallbacks* callbacks = 135 blink::WebPushSubscriptionCallbacks* callbacks =
136 subscription_callbacks_.Lookup(request_id); 136 subscription_callbacks_.Lookup(request_id);
137 DCHECK(callbacks); 137 DCHECK(callbacks);
138 138
139 blink::WebPushError::ErrorType error_type = 139 blink::WebPushError::ErrorType error_type =
140 status == PUSH_REGISTRATION_STATUS_PERMISSION_DENIED 140 status == PUSH_REGISTRATION_STATUS_PERMISSION_DENIED
141 ? blink::WebPushError::ErrorTypePermissionDenied 141 ? blink::WebPushError::ErrorTypeNotAllowed
142 : blink::WebPushError::ErrorTypeAbort; 142 : blink::WebPushError::ErrorTypeAbort;
143 143
144 callbacks->onError(blink::WebPushError( 144 callbacks->onError(blink::WebPushError(
145 error_type, 145 error_type,
146 blink::WebString::fromUTF8(PushRegistrationStatusToString(status)))); 146 blink::WebString::fromUTF8(PushRegistrationStatusToString(status))));
147 147
148 subscription_callbacks_.Remove(request_id); 148 subscription_callbacks_.Remove(request_id);
149 } 149 }
150 150
151 } // namespace content 151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698