| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 ReplaceNotificationIfNeeded(notification_data); | 48 ReplaceNotificationIfNeeded(notification_data); |
| 49 | 49 |
| 50 page_notifications_[title] = delegate.release(); | 50 page_notifications_[title] = delegate.release(); |
| 51 page_notifications_[title]->NotificationDisplayed(); | 51 page_notifications_[title]->NotificationDisplayed(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void LayoutTestNotificationManager::DisplayPersistentNotification( | 54 void LayoutTestNotificationManager::DisplayPersistentNotification( |
| 55 BrowserContext* browser_context, | 55 BrowserContext* browser_context, |
| 56 int64_t persistent_notification_id, | 56 int64_t persistent_notification_id, |
| 57 const GURL& service_worker_scope, |
| 57 const GURL& origin, | 58 const GURL& origin, |
| 58 const PlatformNotificationData& notification_data, | 59 const PlatformNotificationData& notification_data, |
| 59 const NotificationResources& notification_resources) { | 60 const NotificationResources& notification_resources) { |
| 60 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 61 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 61 std::string title = base::UTF16ToUTF8(notification_data.title); | 62 std::string title = base::UTF16ToUTF8(notification_data.title); |
| 62 | 63 |
| 63 ReplaceNotificationIfNeeded(notification_data); | 64 ReplaceNotificationIfNeeded(notification_data); |
| 64 | 65 |
| 65 PersistentNotification notification; | 66 PersistentNotification notification; |
| 66 notification.browser_context = browser_context; | 67 notification.browser_context = browser_context; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { | 200 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { |
| 200 return LayoutTestContentBrowserClient::Get() | 201 return LayoutTestContentBrowserClient::Get() |
| 201 ->GetLayoutTestBrowserContext() | 202 ->GetLayoutTestBrowserContext() |
| 202 ->GetLayoutTestPermissionManager() | 203 ->GetLayoutTestPermissionManager() |
| 203 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, | 204 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, |
| 204 origin, | 205 origin, |
| 205 origin); | 206 origin); |
| 206 } | 207 } |
| 207 | 208 |
| 208 } // namespace content | 209 } // namespace content |
| OLD | NEW |