Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: content/shell/browser/layout_test/layout_test_push_messaging_service.cc

Issue 1093923005: Swap hasPermission with permissionState in browser_tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/push_messaging/push_messaging_message_filter.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/push_messaging/push_messaging_message_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698