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