| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } else { | 94 } else { |
| 95 callback.Run("registration_id", std::vector<uint8_t>() /* p256dh */, | 95 callback.Run("registration_id", std::vector<uint8_t>() /* p256dh */, |
| 96 std::vector<uint8_t>() /* auth */, | 96 std::vector<uint8_t>() /* auth */, |
| 97 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); | 97 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 void LayoutTestPushMessagingService::GetEncryptionInfo( | 101 void LayoutTestPushMessagingService::GetEncryptionInfo( |
| 102 const GURL& origin, | 102 const GURL& origin, |
| 103 int64_t service_worker_registration_id, | 103 int64_t service_worker_registration_id, |
| 104 const std::string& sender_id, |
| 104 const EncryptionInfoCallback& callback) { | 105 const EncryptionInfoCallback& callback) { |
| 105 std::vector<uint8_t> p256dh( | 106 std::vector<uint8_t> p256dh( |
| 106 kTestP256Key, kTestP256Key + arraysize(kTestP256Key)); | 107 kTestP256Key, kTestP256Key + arraysize(kTestP256Key)); |
| 107 std::vector<uint8_t> auth( | 108 std::vector<uint8_t> auth( |
| 108 kAuthentication, kAuthentication + arraysize(kAuthentication)); | 109 kAuthentication, kAuthentication + arraysize(kAuthentication)); |
| 109 | 110 |
| 110 callback.Run(true /* success */, p256dh, auth); | 111 callback.Run(true /* success */, p256dh, auth); |
| 111 } | 112 } |
| 112 | 113 |
| 113 blink::WebPushPermissionStatus | 114 blink::WebPushPermissionStatus |
| (...skipping 11 matching lines...) Expand all Loading... |
| 125 | 126 |
| 126 void LayoutTestPushMessagingService::Unsubscribe( | 127 void LayoutTestPushMessagingService::Unsubscribe( |
| 127 const GURL& requesting_origin, | 128 const GURL& requesting_origin, |
| 128 int64_t service_worker_registration_id, | 129 int64_t service_worker_registration_id, |
| 129 const std::string& sender_id, | 130 const std::string& sender_id, |
| 130 const UnregisterCallback& callback) { | 131 const UnregisterCallback& callback) { |
| 131 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); | 132 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); |
| 132 } | 133 } |
| 133 | 134 |
| 134 } // namespace content | 135 } // namespace content |
| OLD | NEW |