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

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

Issue 1373883003: Move geolocation and permission mojoms into components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 PermissionStatus status) { 27 permission::Status status) {
28 switch (status) { 28 switch (status) {
29 case PERMISSION_STATUS_GRANTED: 29 case permission::STATUS_GRANTED:
30 return blink::WebNotificationPermissionAllowed; 30 return blink::WebNotificationPermissionAllowed;
31 case PERMISSION_STATUS_DENIED: 31 case permission::STATUS_DENIED:
32 return blink::WebNotificationPermissionDenied; 32 return blink::WebNotificationPermissionDenied;
33 case PERMISSION_STATUS_ASK: 33 case permission::STATUS_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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { 195 LayoutTestNotificationManager::CheckPermission(const GURL& origin) {
196 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get() 196 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get()
197 ->GetLayoutTestBrowserContext() 197 ->GetLayoutTestBrowserContext()
198 ->GetLayoutTestPermissionManager() 198 ->GetLayoutTestPermissionManager()
199 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, 199 ->GetPermissionStatus(PermissionType::NOTIFICATIONS,
200 origin, 200 origin,
201 origin)); 201 origin));
202 } 202 }
203 203
204 } // namespace content 204 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698