summaryrefslogtreecommitdiffstats
path: root/content/shell/browser
diff options
context:
space:
mode:
authorharkness <harkness@chromium.org>2016-03-03 10:45:12 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-03 18:47:18 +0000
commit71f5a08bb30153b56e8a3f9b447264a54b6d9c12 (patch)
tree505c9b6d2bc012268ebbb0b077fdfb4e10ad02c0 /content/shell/browser
parent957c25f0040df81f08a9da2e84348db174d59d15 (diff)
downloadchromium_src-71f5a08bb30153b56e8a3f9b447264a54b6d9c12.zip
chromium_src-71f5a08bb30153b56e8a3f9b447264a54b6d9c12.tar.gz
chromium_src-71f5a08bb30153b56e8a3f9b447264a54b6d9c12.tar.bz2
Partial implementation of subscription restrictions.
Currently, chrome requires that app developers provide a "sender_id" tag in the manifest. This id is generated by the developer console and is not standard for all browsers. In the future, the app developer will be able to specify a public key for their service, which will be registered with the push service and which the push service can use to validate app services requesting to send messages. BUG=583753 Review URL: https://codereview.chromium.org/1701313002 Cr-Commit-Position: refs/heads/master@{#379045}
Diffstat (limited to 'content/shell/browser')
-rw-r--r--content/shell/browser/layout_test/layout_test_push_messaging_service.cc11
-rw-r--r--content/shell/browser/layout_test/layout_test_push_messaging_service.h8
2 files changed, 9 insertions, 10 deletions
diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
index 11554e9..c346a08 100644
--- a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
+++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "content/public/browser/permission_type.h"
+#include "content/public/common/push_subscription_options.h"
#include "content/shell/browser/layout_test/layout_test_browser_context.h"
#include "content/shell/browser/layout_test/layout_test_content_browser_client.h"
#include "content/shell/browser/layout_test/layout_test_permission_manager.h"
@@ -67,22 +68,20 @@ GURL LayoutTestPushMessagingService::GetPushEndpoint() {
void LayoutTestPushMessagingService::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 PushSubscriptionOptions& options,
const PushMessagingService::RegisterCallback& callback) {
SubscribeFromWorker(requesting_origin, service_worker_registration_id,
- sender_id, user_visible, callback);
+ options, callback);
}
void LayoutTestPushMessagingService::SubscribeFromWorker(
const GURL& requesting_origin,
int64_t service_worker_registration_id,
- const std::string& sender_id,
- bool user_visible,
+ const PushSubscriptionOptions& options,
const PushMessagingService::RegisterCallback& callback) {
- if (GetPermissionStatus(requesting_origin, user_visible) ==
+ if (GetPermissionStatus(requesting_origin, options.user_visible_only) ==
blink::WebPushPermissionStatusGranted) {
std::vector<uint8_t> p256dh(
kTestP256Key, kTestP256Key + arraysize(kTestP256Key));
diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.h b/content/shell/browser/layout_test/layout_test_push_messaging_service.h
index eb5e7e4..5e5a7a48 100644
--- a/content/shell/browser/layout_test/layout_test_push_messaging_service.h
+++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.h
@@ -17,6 +17,8 @@
namespace content {
+struct PushSubscriptionOptions;
+
class LayoutTestPushMessagingService : public PushMessagingService {
public:
LayoutTestPushMessagingService();
@@ -27,16 +29,14 @@ class LayoutTestPushMessagingService : public PushMessagingService {
void 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 PushSubscriptionOptions& options,
const PushMessagingService::RegisterCallback& callback) override;
void SubscribeFromWorker(
const GURL& requesting_origin,
int64_t service_worker_registration_id,
- const std::string& sender_id,
- bool user_visible,
+ const PushSubscriptionOptions& options,
const PushMessagingService::RegisterCallback& callback) override;
void GetEncryptionInfo(
const GURL& origin,