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 0d85dee2a393bc26903a7da4a700335e8f46f3f7..40741eb2371d9d9eb8e658c27c62bc49e1310451 100644 |
--- a/content/child/push_messaging/push_provider.cc |
+++ b/content/child/push_messaging/push_provider.cc |
@@ -251,13 +251,25 @@ 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."; |
+ } |
+ |
+ scoped_ptr<blink::WebPushError> web_error(new blink::WebPushError( |
+ error, blink::WebString::fromUTF8(error_message))); |
+ |
+ callbacks->onError(web_error.release()); |
Avi (use Gerrit)
2015/05/13 15:44:31
This bothers me because the definition of onError
|
permission_status_callbacks_.Remove(request_id); |
} |