| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // 92-bit (12 byte) authentication key associated with a subscription. | 33 // 92-bit (12 byte) authentication key associated with a subscription. |
| 34 const uint8_t kAuthentication[] = { | 34 const uint8_t kAuthentication[] = { |
| 35 0xA5, 0xD9, 0x3C, 0x43, 0x0C, 0x00, 0xA9, 0xE3, 0x1E, 0x65, 0xBF, 0xA1 | 35 0xA5, 0xD9, 0x3C, 0x43, 0x0C, 0x00, 0xA9, 0xE3, 0x1E, 0x65, 0xBF, 0xA1 |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 static_assert(sizeof(kAuthentication) == 12, | 38 static_assert(sizeof(kAuthentication) == 12, |
| 39 "The fake authentication key must be at least 12 bytes in size."); | 39 "The fake authentication key must be at least 12 bytes in size."); |
| 40 | 40 |
| 41 blink::WebPushPermissionStatus ToWebPushPermissionStatus( | 41 blink::WebPushPermissionStatus ToWebPushPermissionStatus( |
| 42 mojom::PermissionStatus status) { | 42 blink::mojom::PermissionStatus status) { |
| 43 switch (status) { | 43 switch (status) { |
| 44 case mojom::PermissionStatus::GRANTED: | 44 case blink::mojom::PermissionStatus::GRANTED: |
| 45 return blink::WebPushPermissionStatusGranted; | 45 return blink::WebPushPermissionStatusGranted; |
| 46 case mojom::PermissionStatus::DENIED: | 46 case blink::mojom::PermissionStatus::DENIED: |
| 47 return blink::WebPushPermissionStatusDenied; | 47 return blink::WebPushPermissionStatusDenied; |
| 48 case mojom::PermissionStatus::ASK: | 48 case blink::mojom::PermissionStatus::ASK: |
| 49 return blink::WebPushPermissionStatusPrompt; | 49 return blink::WebPushPermissionStatusPrompt; |
| 50 } | 50 } |
| 51 | 51 |
| 52 NOTREACHED(); | 52 NOTREACHED(); |
| 53 return blink::WebPushPermissionStatusLast; | 53 return blink::WebPushPermissionStatusLast; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // anonymous namespace | 56 } // anonymous namespace |
| 57 | 57 |
| 58 LayoutTestPushMessagingService::LayoutTestPushMessagingService() { | 58 LayoutTestPushMessagingService::LayoutTestPushMessagingService() { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 void LayoutTestPushMessagingService::Unsubscribe( | 125 void LayoutTestPushMessagingService::Unsubscribe( |
| 126 const GURL& requesting_origin, | 126 const GURL& requesting_origin, |
| 127 int64_t service_worker_registration_id, | 127 int64_t service_worker_registration_id, |
| 128 const std::string& sender_id, | 128 const std::string& sender_id, |
| 129 const UnregisterCallback& callback) { | 129 const UnregisterCallback& callback) { |
| 130 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); | 130 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace content | 133 } // namespace content |
| OLD | NEW |