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

Side by Side Diff: content/shell/browser/layout_test/layout_test_push_messaging_service.cc

Issue 2935333003: Propagate the user gesture bit when requesting push messaging permission. (Closed)
Patch Set: ThreadSafe user gesture check Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/browser/layout_test/layout_test_push_messaging_service.h " 5 #include "content/shell/browser/layout_test/layout_test_push_messaging_service.h "
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/public/browser/permission_type.h" 10 #include "content/public/browser/permission_type.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return GURL(standard_protocol ? "https://example.com/StandardizedEndpoint/" 68 return GURL(standard_protocol ? "https://example.com/StandardizedEndpoint/"
69 : "https://example.com/LayoutTestEndpoint/"); 69 : "https://example.com/LayoutTestEndpoint/");
70 } 70 }
71 71
72 void LayoutTestPushMessagingService::SubscribeFromDocument( 72 void LayoutTestPushMessagingService::SubscribeFromDocument(
73 const GURL& requesting_origin, 73 const GURL& requesting_origin,
74 int64_t service_worker_registration_id, 74 int64_t service_worker_registration_id,
75 int renderer_id, 75 int renderer_id,
76 int render_frame_id, 76 int render_frame_id,
77 const PushSubscriptionOptions& options, 77 const PushSubscriptionOptions& options,
78 bool user_gesture,
78 const RegisterCallback& callback) { 79 const RegisterCallback& callback) {
79 SubscribeFromWorker(requesting_origin, service_worker_registration_id, 80 SubscribeFromWorker(requesting_origin, service_worker_registration_id,
80 options, callback); 81 options, callback);
81 } 82 }
82 83
83 void LayoutTestPushMessagingService::SubscribeFromWorker( 84 void LayoutTestPushMessagingService::SubscribeFromWorker(
84 const GURL& requesting_origin, 85 const GURL& requesting_origin,
85 int64_t service_worker_registration_id, 86 int64_t service_worker_registration_id,
86 const PushSubscriptionOptions& options, 87 const PushSubscriptionOptions& options,
87 const RegisterCallback& callback) { 88 const RegisterCallback& callback) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 const GURL& origin, 155 const GURL& origin,
155 int64_t service_worker_registration_id) { 156 int64_t service_worker_registration_id) {
156 if (service_worker_registration_id == 157 if (service_worker_registration_id ==
157 subscribed_service_worker_registration_) { 158 subscribed_service_worker_registration_) {
158 subscribed_service_worker_registration_ = 159 subscribed_service_worker_registration_ =
159 kInvalidServiceWorkerRegistrationId; 160 kInvalidServiceWorkerRegistrationId;
160 } 161 }
161 } 162 }
162 163
163 } // namespace content 164 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698