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 22 matching lines...) Expand all Loading... |
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 PermissionStatus status) { |
42 switch (status) { | 42 switch (status) { |
43 case PERMISSION_STATUS_GRANTED: | 43 case PermissionStatus::GRANTED: |
44 return blink::WebPushPermissionStatusGranted; | 44 return blink::WebPushPermissionStatusGranted; |
45 case PERMISSION_STATUS_DENIED: | 45 case PermissionStatus::DENIED: |
46 return blink::WebPushPermissionStatusDenied; | 46 return blink::WebPushPermissionStatusDenied; |
47 case PERMISSION_STATUS_ASK: | 47 case 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 void LayoutTestPushMessagingService::Unsubscribe( | 130 void LayoutTestPushMessagingService::Unsubscribe( |
131 const GURL& requesting_origin, | 131 const GURL& requesting_origin, |
132 int64_t service_worker_registration_id, | 132 int64_t service_worker_registration_id, |
133 const std::string& sender_id, | 133 const std::string& sender_id, |
134 const UnregisterCallback& callback) { | 134 const UnregisterCallback& callback) { |
135 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); | 135 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); |
136 } | 136 } |
137 | 137 |
138 } // namespace content | 138 } // namespace content |
OLD | NEW |