| 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_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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 LayoutTestNotificationManager::LayoutTestNotificationManager() | 43 LayoutTestNotificationManager::LayoutTestNotificationManager() |
| 44 : weak_factory_(this) {} | 44 : weak_factory_(this) {} |
| 45 | 45 |
| 46 LayoutTestNotificationManager::~LayoutTestNotificationManager() {} | 46 LayoutTestNotificationManager::~LayoutTestNotificationManager() {} |
| 47 | 47 |
| 48 void LayoutTestNotificationManager::DisplayNotification( | 48 void LayoutTestNotificationManager::DisplayNotification( |
| 49 BrowserContext* browser_context, | 49 BrowserContext* browser_context, |
| 50 const GURL& origin, | 50 const GURL& origin, |
| 51 const PlatformNotificationData& notification_data, | 51 const PlatformNotificationData& notification_data, |
| 52 const NotificationResources& notification_resources, | 52 const NotificationResources& notification_resources, |
| 53 scoped_ptr<DesktopNotificationDelegate> delegate, | 53 std::unique_ptr<DesktopNotificationDelegate> delegate, |
| 54 base::Closure* cancel_callback) { | 54 base::Closure* cancel_callback) { |
| 55 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 55 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 56 std::string title = base::UTF16ToUTF8(notification_data.title); | 56 std::string title = base::UTF16ToUTF8(notification_data.title); |
| 57 | 57 |
| 58 DCHECK(cancel_callback); | 58 DCHECK(cancel_callback); |
| 59 *cancel_callback = base::Bind(&LayoutTestNotificationManager::Close, | 59 *cancel_callback = base::Bind(&LayoutTestNotificationManager::Close, |
| 60 weak_factory_.GetWeakPtr(), | 60 weak_factory_.GetWeakPtr(), |
| 61 title); | 61 title); |
| 62 | 62 |
| 63 ReplaceNotificationIfNeeded(notification_data); | 63 ReplaceNotificationIfNeeded(notification_data); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |