Chromium Code Reviews| Index: content/child/push_messaging/push_provider.cc |
| diff --git a/content/child/push_messaging/push_provider.cc b/content/child/push_messaging/push_provider.cc |
| index 23033b5820d76617cf177a8f7dc8739fff6cc2d8..14c657ac283cfbf376db8ab10516a1fe21f801a5 100644 |
| --- a/content/child/push_messaging/push_provider.cc |
| +++ b/content/child/push_messaging/push_provider.cc |
| @@ -279,13 +279,27 @@ void PushProvider::OnGetPermissionStatusSuccess( |
| permission_status_callbacks_.Remove(request_id); |
| } |
| -void PushProvider::OnGetPermissionStatusError(int request_id) { |
| +void PushProvider::OnGetPermissionStatusError( |
| + int request_id, |
| + blink::WebPushError::ErrorType error) { |
| blink::WebPushPermissionStatusCallbacks* callbacks = |
| permission_status_callbacks_.Lookup(request_id); |
| if (!callbacks) |
| return; |
| - callbacks->onError(); |
| + std::string error_message; |
| + if (error == blink::WebPushError::ErrorTypeNotSupported) { |
| + error_message = |
| + "push subscriptions that don't enable userVisibleOnly are not " |
| + "supported."; |
|
Peter Beverloo
2015/05/11 12:56:07
Capitalization - it's a sentence.
Miguel Garcia
2015/05/11 13:50:38
Done.
|
| + } else { |
| + error_message = ""; |
|
Peter Beverloo
2015/05/11 12:56:07
No need to set it to an empty string - the constru
Miguel Garcia
2015/05/11 13:50:38
Done.
|
| + } |
| + |
| + scoped_ptr<blink::WebPushError> web_error(new blink::WebPushError( |
| + error, blink::WebString::fromUTF8(error_message))); |
| + |
| + callbacks->onError(web_error.release()); |
| permission_status_callbacks_.Remove(request_id); |
| } |