| 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 "chrome/browser/notifications/platform_notification_service_impl.h" | 5 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // see the notification anyway, since we are shutting down. | 280 // see the notification anyway, since we are shutting down. |
| 281 if (g_browser_process->IsShuttingDown()) | 281 if (g_browser_process->IsShuttingDown()) |
| 282 return; | 282 return; |
| 283 | 283 |
| 284 Profile* profile = Profile::FromBrowserContext(browser_context); | 284 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 285 DCHECK(profile); | 285 DCHECK(profile); |
| 286 DCHECK_EQ(0u, notification_data.actions.size()); | 286 DCHECK_EQ(0u, notification_data.actions.size()); |
| 287 DCHECK_EQ(0u, notification_resources.action_icons.size()); | 287 DCHECK_EQ(0u, notification_resources.action_icons.size()); |
| 288 | 288 |
| 289 NotificationObjectProxy* proxy = new NotificationObjectProxy( | 289 NotificationObjectProxy* proxy = new NotificationObjectProxy( |
| 290 browser_context, notification_id, std::move(delegate)); | 290 browser_context, notification_id, origin, std::move(delegate)); |
| 291 Notification notification = CreateNotificationFromData( | 291 Notification notification = CreateNotificationFromData( |
| 292 profile, GURL() /* service_worker_scope */, origin, notification_data, | 292 profile, GURL() /* service_worker_scope */, origin, notification_data, |
| 293 notification_resources, proxy); | 293 notification_resources, proxy); |
| 294 | 294 |
| 295 GetNotificationDisplayService(profile)->Display( | 295 GetNotificationDisplayService(profile)->Display( |
| 296 NotificationCommon::NON_PERSISTENT, notification.delegate_id(), | 296 NotificationCommon::NON_PERSISTENT, notification.delegate_id(), |
| 297 notification); | 297 notification); |
| 298 if (cancel_callback) { | 298 if (cancel_callback) { |
| 299 #if defined(OS_WIN) | 299 #if defined(OS_WIN) |
| 300 std::string profile_id = | 300 std::string profile_id = |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 } | 484 } |
| 485 #endif | 485 #endif |
| 486 | 486 |
| 487 return base::string16(); | 487 return base::string16(); |
| 488 } | 488 } |
| 489 | 489 |
| 490 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting( | 490 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting( |
| 491 NotificationDisplayService* display_service) { | 491 NotificationDisplayService* display_service) { |
| 492 test_display_service_ = display_service; | 492 test_display_service_ = display_service; |
| 493 } | 493 } |
| OLD | NEW |