| 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 "content/public/browser/permission_type.h" | 9 #include "content/public/browser/permission_type.h" |
| 10 #include "content/shell/browser/layout_test/layout_test_browser_context.h" | 10 #include "content/shell/browser/layout_test/layout_test_browser_context.h" |
| 11 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" | 11 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" |
| 12 #include "content/shell/browser/layout_test/layout_test_permission_manager.h" | 12 #include "content/shell/browser/layout_test/layout_test_permission_manager.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 blink::WebPushPermissionStatus ToWebPushPermissionStatus( | 18 blink::WebPushPermissionStatus ToWebPushPermissionStatus( |
| 19 PermissionStatus status) { | 19 PermissionStatus status) { |
| 20 switch (status) { | 20 switch (status) { |
| 21 case PERMISSION_STATUS_GRANTED: | 21 case PERMISSION_STATUS_GRANTED: |
| 22 return blink::WebPushPermissionStatusGranted; | 22 return blink::WebPushPermissionStatusGranted; |
| 23 case PERMISSION_STATUS_DENIED: | 23 case PERMISSION_STATUS_DENIED: |
| 24 return blink::WebPushPermissionStatusDenied; | 24 return blink::WebPushPermissionStatusDenied; |
| 25 case PERMISSION_STATUS_ASK: | 25 case PERMISSION_STATUS_ASK: |
| 26 return blink::WebPushPermissionStatusDefault; | 26 return blink::WebPushPermissionStatusPrompt; |
| 27 } | 27 } |
| 28 | 28 |
| 29 NOTREACHED(); | 29 NOTREACHED(); |
| 30 return blink::WebPushPermissionStatusLast; | 30 return blink::WebPushPermissionStatusLast; |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // anonymous namespace | 33 } // anonymous namespace |
| 34 | 34 |
| 35 LayoutTestPushMessagingService::LayoutTestPushMessagingService() { | 35 LayoutTestPushMessagingService::LayoutTestPushMessagingService() { |
| 36 } | 36 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 void LayoutTestPushMessagingService::Unregister( | 85 void LayoutTestPushMessagingService::Unregister( |
| 86 const GURL& requesting_origin, | 86 const GURL& requesting_origin, |
| 87 int64 service_worker_registration_id, | 87 int64 service_worker_registration_id, |
| 88 const std::string& sender_id, | 88 const std::string& sender_id, |
| 89 const UnregisterCallback& callback) { | 89 const UnregisterCallback& callback) { |
| 90 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); | 90 callback.Run(PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace content | 93 } // namespace content |
| OLD | NEW |