| Index: chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.cc b/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| index b5f409e4accbf02adb278c330c12f5b82809b7af..489590713bf16486d53379994477292dcab14865 100644
|
| --- a/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| +++ b/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| @@ -44,6 +44,7 @@
|
| #include "content/public/common/child_process_host.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "content/public/common/push_messaging_status.h"
|
| +#include "content/public/common/push_subscription_options.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
|
|
| #if BUILDFLAG(ENABLE_BACKGROUND)
|
| @@ -344,10 +345,9 @@ GURL PushMessagingServiceImpl::GetPushEndpoint() {
|
| void PushMessagingServiceImpl::SubscribeFromDocument(
|
| const GURL& requesting_origin,
|
| int64_t service_worker_registration_id,
|
| - const std::string& sender_id,
|
| int renderer_id,
|
| int render_frame_id,
|
| - bool user_visible,
|
| + const content::PushSubscriptionOptions& options,
|
| const content::PushMessagingService::RegisterCallback& callback) {
|
| PushMessagingAppIdentifier app_identifier =
|
| PushMessagingAppIdentifier::Generate(requesting_origin,
|
| @@ -367,7 +367,7 @@ void PushMessagingServiceImpl::SubscribeFromDocument(
|
| if (!web_contents)
|
| return;
|
|
|
| - if (!user_visible) {
|
| + if (!options.user_visible_only) {
|
| web_contents->GetMainFrame()->AddMessageToConsole(
|
| content::CONSOLE_MESSAGE_LEVEL_ERROR, kSilentPushUnsupportedMessage);
|
|
|
| @@ -381,15 +381,14 @@ void PushMessagingServiceImpl::SubscribeFromDocument(
|
| content::PermissionType::PUSH_MESSAGING, web_contents->GetMainFrame(),
|
| requesting_origin,
|
| base::Bind(&PushMessagingServiceImpl::DidRequestPermission,
|
| - weak_factory_.GetWeakPtr(), app_identifier, sender_id,
|
| + weak_factory_.GetWeakPtr(), app_identifier, options,
|
| callback));
|
| }
|
|
|
| void PushMessagingServiceImpl::SubscribeFromWorker(
|
| const GURL& requesting_origin,
|
| int64_t service_worker_registration_id,
|
| - const std::string& sender_id,
|
| - bool user_visible,
|
| + const content::PushSubscriptionOptions& options,
|
| const content::PushMessagingService::RegisterCallback& register_callback) {
|
| PushMessagingAppIdentifier app_identifier =
|
| PushMessagingAppIdentifier::Generate(requesting_origin,
|
| @@ -404,7 +403,7 @@ void PushMessagingServiceImpl::SubscribeFromWorker(
|
|
|
| blink::WebPushPermissionStatus permission_status =
|
| PushMessagingServiceImpl::GetPermissionStatus(requesting_origin,
|
| - user_visible);
|
| + options.user_visible_only);
|
|
|
| if (permission_status != blink::WebPushPermissionStatusGranted) {
|
| SubscribeEndWithError(register_callback,
|
| @@ -413,7 +412,7 @@ void PushMessagingServiceImpl::SubscribeFromWorker(
|
| }
|
|
|
| IncreasePushSubscriptionCount(1, true /* is_pending */);
|
| - std::vector<std::string> sender_ids(1, sender_id);
|
| + std::vector<std::string> sender_ids(1, options.sender_info);
|
| GetGCMDriver()->Register(app_identifier.app_id(), sender_ids,
|
| base::Bind(&PushMessagingServiceImpl::DidSubscribe,
|
| weak_factory_.GetWeakPtr(),
|
| @@ -516,7 +515,7 @@ void PushMessagingServiceImpl::DidSubscribeWithEncryptionInfo(
|
|
|
| void PushMessagingServiceImpl::DidRequestPermission(
|
| const PushMessagingAppIdentifier& app_identifier,
|
| - const std::string& sender_id,
|
| + const content::PushSubscriptionOptions& options,
|
| const content::PushMessagingService::RegisterCallback& register_callback,
|
| content::PermissionStatus permission_status) {
|
| if (permission_status != content::PermissionStatus::GRANTED) {
|
| @@ -526,7 +525,7 @@ void PushMessagingServiceImpl::DidRequestPermission(
|
| }
|
|
|
| IncreasePushSubscriptionCount(1, true /* is_pending */);
|
| - std::vector<std::string> sender_ids(1, sender_id);
|
| + std::vector<std::string> sender_ids(1, options.sender_info);
|
| GetGCMDriver()->Register(app_identifier.app_id(), sender_ids,
|
| base::Bind(&PushMessagingServiceImpl::DidSubscribe,
|
| weak_factory_.GetWeakPtr(),
|
|
|