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

Unified Diff: content/child/push_messaging/push_provider.cc

Issue 2133673002: Push API: Implement and ship PushSubscription.options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add MODULES_EXPORT Created 4 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
« no previous file with comments | « content/child/push_messaging/push_provider.h ('k') | content/common/push_messaging_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 59992b76dea44cf3b9138fc11ce8cdbd4ca6d21f..19699140d79efcdb66cbefc89630c1e61853b33d 100644
--- a/content/child/push_messaging/push_provider.cc
+++ b/content/child/push_messaging/push_provider.cc
@@ -15,6 +15,7 @@
#include "content/child/thread_safe_sender.h"
#include "content/common/push_messaging_messages.h"
#include "content/public/common/child_process_host.h"
+#include "content/public/common/push_subscription_options.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/modules/push_messaging/WebPushSubscription.h"
#include "third_party/WebKit/public/platform/modules/push_messaging/WebPushSubscriptionOptions.h"
@@ -158,6 +159,7 @@ bool PushProvider::OnMessageReceived(const IPC::Message& message) {
void PushProvider::OnSubscribeFromWorkerSuccess(
int request_id,
const GURL& endpoint,
+ const PushSubscriptionOptions& options,
const std::vector<uint8_t>& p256dh,
const std::vector<uint8_t>& auth) {
blink::WebPushSubscriptionCallbacks* callbacks =
@@ -165,8 +167,9 @@ void PushProvider::OnSubscribeFromWorkerSuccess(
if (!callbacks)
return;
- callbacks->onSuccess(
- base::WrapUnique(new blink::WebPushSubscription(endpoint, p256dh, auth)));
+ callbacks->onSuccess(base::WrapUnique(new blink::WebPushSubscription(
+ endpoint, options.user_visible_only,
+ blink::WebString::fromLatin1(options.sender_info), p256dh, auth)));
subscription_callbacks_.Remove(request_id);
}
@@ -218,6 +221,7 @@ void PushProvider::OnUnsubscribeError(int request_id,
void PushProvider::OnGetSubscriptionSuccess(
int request_id,
const GURL& endpoint,
+ const PushSubscriptionOptions& options,
const std::vector<uint8_t>& p256dh,
const std::vector<uint8_t>& auth) {
blink::WebPushSubscriptionCallbacks* callbacks =
@@ -225,8 +229,9 @@ void PushProvider::OnGetSubscriptionSuccess(
if (!callbacks)
return;
- callbacks->onSuccess(
- base::WrapUnique(new blink::WebPushSubscription(endpoint, p256dh, auth)));
+ callbacks->onSuccess(base::WrapUnique(new blink::WebPushSubscription(
+ endpoint, options.user_visible_only,
+ blink::WebString::fromLatin1(options.sender_info), p256dh, auth)));
subscription_callbacks_.Remove(request_id);
}
« no previous file with comments | « content/child/push_messaging/push_provider.h ('k') | content/common/push_messaging_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698