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

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

Issue 1771743002: Move geolocation and permission mojoms into WebKit/public/platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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_notification_manager.h" 5 #include "content/shell/browser/layout_test/layout_test_notification_manager.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/desktop_notification_delegate.h" 10 #include "content/public/browser/desktop_notification_delegate.h"
11 #include "content/public/browser/notification_event_dispatcher.h" 11 #include "content/public/browser/notification_event_dispatcher.h"
12 #include "content/public/browser/permission_type.h" 12 #include "content/public/browser/permission_type.h"
13 #include "content/public/common/persistent_notification_status.h" 13 #include "content/public/common/persistent_notification_status.h"
14 #include "content/public/common/platform_notification_data.h" 14 #include "content/public/common/platform_notification_data.h"
15 #include "content/shell/browser/layout_test/layout_test_browser_context.h" 15 #include "content/shell/browser/layout_test/layout_test_browser_context.h"
16 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h " 16 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h "
17 #include "content/shell/browser/layout_test/layout_test_permission_manager.h" 17 #include "content/shell/browser/layout_test/layout_test_permission_manager.h"
18 18
19 namespace content { 19 namespace content {
20 namespace { 20 namespace {
21 21
22 // The Web Notification layout tests don't care about the lifetime of the 22 // The Web Notification layout tests don't care about the lifetime of the
23 // Service Worker when a notificationclick event has been dispatched. 23 // Service Worker when a notificationclick event has been dispatched.
24 void OnEventDispatchComplete(PersistentNotificationStatus status) {} 24 void OnEventDispatchComplete(PersistentNotificationStatus status) {}
25 25
26 blink::WebNotificationPermission ToWebNotificationPermission( 26 blink::WebNotificationPermission ToWebNotificationPermission(
27 mojom::PermissionStatus status) { 27 blink::mojom::PermissionStatus status) {
28 switch (status) { 28 switch (status) {
29 case mojom::PermissionStatus::GRANTED: 29 case blink::mojom::PermissionStatus::GRANTED:
30 return blink::WebNotificationPermissionAllowed; 30 return blink::WebNotificationPermissionAllowed;
31 case mojom::PermissionStatus::DENIED: 31 case blink::mojom::PermissionStatus::DENIED:
32 return blink::WebNotificationPermissionDenied; 32 return blink::WebNotificationPermissionDenied;
33 case mojom::PermissionStatus::ASK: 33 case blink::mojom::PermissionStatus::ASK:
34 return blink::WebNotificationPermissionDefault; 34 return blink::WebNotificationPermissionDefault;
35 } 35 }
36 36
37 NOTREACHED(); 37 NOTREACHED();
38 return blink::WebNotificationPermissionLast; 38 return blink::WebNotificationPermissionLast;
39 } 39 }
40 40
41 } // namespace 41 } // namespace
42 42
43 LayoutTestNotificationManager::LayoutTestNotificationManager() 43 LayoutTestNotificationManager::LayoutTestNotificationManager()
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { 214 LayoutTestNotificationManager::CheckPermission(const GURL& origin) {
215 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get() 215 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get()
216 ->GetLayoutTestBrowserContext() 216 ->GetLayoutTestBrowserContext()
217 ->GetLayoutTestPermissionManager() 217 ->GetLayoutTestPermissionManager()
218 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, 218 ->GetPermissionStatus(PermissionType::NOTIFICATIONS,
219 origin, 219 origin,
220 origin)); 220 origin));
221 } 221 }
222 222
223 } // namespace content 223 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698