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

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

Issue 2908133003: Split GetPermissionStatus into GetPermissionStatusForFrame/Worker
Patch Set: Split GetPermissionStatus into GetPermissionStatusForFrame/Worker 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 kTestP256Key, kTestP256Key + arraysize(kTestP256Key)); 112 kTestP256Key, kTestP256Key + arraysize(kTestP256Key));
113 std::vector<uint8_t> auth( 113 std::vector<uint8_t> auth(
114 kAuthentication, kAuthentication + arraysize(kAuthentication)); 114 kAuthentication, kAuthentication + arraysize(kAuthentication));
115 115
116 callback.Run(true /* is_valid */, p256dh, auth); 116 callback.Run(true /* is_valid */, p256dh, auth);
117 } 117 }
118 118
119 blink::WebPushPermissionStatus 119 blink::WebPushPermissionStatus
120 LayoutTestPushMessagingService::GetPermissionStatus(const GURL& origin, 120 LayoutTestPushMessagingService::GetPermissionStatus(const GURL& origin,
121 bool user_visible) { 121 bool user_visible) {
122 return ToWebPushPermissionStatus(LayoutTestContentBrowserClient::Get() 122 return ToWebPushPermissionStatus(
123 ->browser_context() 123 LayoutTestContentBrowserClient::Get()
124 ->GetPermissionManager() 124 ->browser_context()
125 ->GetPermissionStatus(PermissionType::PUSH_MESSAGING, origin, origin)); 125 ->GetPermissionManager()
126 ->GetPermissionStatusForWorker(PermissionType::PUSH_MESSAGING,
127 origin));
benwells 2017/05/31 01:48:10 Again, this is weird but as it's a test I can live
raymes 2017/06/01 02:54:40 Done.
126 } 128 }
127 129
128 bool LayoutTestPushMessagingService::SupportNonVisibleMessages() { 130 bool LayoutTestPushMessagingService::SupportNonVisibleMessages() {
129 return false; 131 return false;
130 } 132 }
131 133
132 void LayoutTestPushMessagingService::Unsubscribe( 134 void LayoutTestPushMessagingService::Unsubscribe(
133 PushUnregistrationReason reason, 135 PushUnregistrationReason reason,
134 const GURL& requesting_origin, 136 const GURL& requesting_origin,
135 int64_t service_worker_registration_id, 137 int64_t service_worker_registration_id,
(...skipping 18 matching lines...) Expand all
154 const GURL& origin, 156 const GURL& origin,
155 int64_t service_worker_registration_id) { 157 int64_t service_worker_registration_id) {
156 if (service_worker_registration_id == 158 if (service_worker_registration_id ==
157 subscribed_service_worker_registration_) { 159 subscribed_service_worker_registration_) {
158 subscribed_service_worker_registration_ = 160 subscribed_service_worker_registration_ =
159 kInvalidServiceWorkerRegistrationId; 161 kInvalidServiceWorkerRegistrationId;
160 } 162 }
161 } 163 }
162 164
163 } // namespace content 165 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698