| OLD | NEW |
| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 kTestP256Key, kTestP256Key + arraysize(kTestP256Key)); | 106 kTestP256Key, kTestP256Key + arraysize(kTestP256Key)); |
| 107 std::vector<uint8_t> auth( | 107 std::vector<uint8_t> auth( |
| 108 kAuthentication, kAuthentication + arraysize(kAuthentication)); | 108 kAuthentication, kAuthentication + arraysize(kAuthentication)); |
| 109 | 109 |
| 110 callback.Run(true /* success */, p256dh, auth); | 110 callback.Run(true /* success */, p256dh, auth); |
| 111 } | 111 } |
| 112 | 112 |
| 113 blink::WebPushPermissionStatus | 113 blink::WebPushPermissionStatus |
| 114 LayoutTestPushMessagingService::GetPermissionStatus(const GURL& origin, | 114 LayoutTestPushMessagingService::GetPermissionStatus(const GURL& origin, |
| 115 bool user_visible) { | 115 bool user_visible) { |
| 116 return ToWebPushPermissionStatus(LayoutTestContentBrowserClient::Get() | 116 const url::Origin actual_origin(origin); |
| 117 ->browser_context() | 117 return ToWebPushPermissionStatus( |
| 118 ->GetPermissionManager() | 118 LayoutTestContentBrowserClient::Get() |
| 119 ->GetPermissionStatus(PermissionType::PUSH_MESSAGING, origin, origin)); | 119 ->browser_context() |
| 120 ->GetPermissionManager() |
| 121 ->GetPermissionStatus(PermissionType::PUSH_MESSAGING, actual_origin, |
| 122 actual_origin)); |
| 120 } | 123 } |
| 121 | 124 |
| 122 bool LayoutTestPushMessagingService::SupportNonVisibleMessages() { | 125 bool LayoutTestPushMessagingService::SupportNonVisibleMessages() { |
| 123 return false; | 126 return false; |
| 124 } | 127 } |
| 125 | 128 |
| 126 void LayoutTestPushMessagingService::Unsubscribe( | 129 void LayoutTestPushMessagingService::Unsubscribe( |
| 127 const GURL& requesting_origin, | 130 const GURL& requesting_origin, |
| 128 int64_t service_worker_registration_id, | 131 int64_t service_worker_registration_id, |
| 129 const std::string& sender_id, | 132 const std::string& sender_id, |
| 130 const UnregisterCallback& callback) { | 133 const UnregisterCallback& callback) { |
| 131 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); | 134 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); |
| 132 } | 135 } |
| 133 | 136 |
| 134 } // namespace content | 137 } // namespace content |
| OLD | NEW |