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

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

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: rebase Created 4 years, 11 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 PermissionStatus status) {
28 switch (status) { 28 switch (status) {
29 case PERMISSION_STATUS_GRANTED: 29 case PermissionStatus::GRANTED:
30 return blink::WebNotificationPermissionAllowed; 30 return blink::WebNotificationPermissionAllowed;
31 case PERMISSION_STATUS_DENIED: 31 case PermissionStatus::DENIED:
32 return blink::WebNotificationPermissionDenied; 32 return blink::WebNotificationPermissionDenied;
33 case PERMISSION_STATUS_ASK: 33 case 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { 196 LayoutTestNotificationManager::CheckPermission(const GURL& origin) {
197 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get() 197 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get()
198 ->GetLayoutTestBrowserContext() 198 ->GetLayoutTestBrowserContext()
199 ->GetLayoutTestPermissionManager() 199 ->GetLayoutTestPermissionManager()
200 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, 200 ->GetPermissionStatus(PermissionType::NOTIFICATIONS,
201 origin, 201 origin,
202 origin)); 202 origin));
203 } 203 }
204 204
205 } // namespace content 205 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/usb/web_usb_device_impl.cc ('k') | content/shell/browser/layout_test/layout_test_permission_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698