| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 content::PersistentNotificationStatus status) { | 86 content::PersistentNotificationStatus status) { |
| 87 UMA_HISTOGRAM_ENUMERATION( | 87 UMA_HISTOGRAM_ENUMERATION( |
| 88 "Notifications.PersistentWebNotificationCloseResult", status, | 88 "Notifications.PersistentWebNotificationCloseResult", status, |
| 89 content::PersistentNotificationStatus:: | 89 content::PersistentNotificationStatus:: |
| 90 PERSISTENT_NOTIFICATION_STATUS_MAX); | 90 PERSISTENT_NOTIFICATION_STATUS_MAX); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void OnCloseNonPersistentNotificationProfileLoaded( | 93 void OnCloseNonPersistentNotificationProfileLoaded( |
| 94 const std::string& notification_id, | 94 const std::string& notification_id, |
| 95 Profile* profile) { | 95 Profile* profile) { |
| 96 PlatformNotificationServiceImpl::GetInstance() | 96 NotificationDisplayServiceFactory::GetForProfile(profile)->Close( |
| 97 ->GetNotificationDisplayService(profile) | 97 notification_id); |
| 98 ->Close(notification_id); | |
| 99 } | 98 } |
| 100 | 99 |
| 101 // Callback to run once the profile has been loaded in order to perform a | 100 // Callback to run once the profile has been loaded in order to perform a |
| 102 // given |operation| in a notification. | 101 // given |operation| in a notification. |
| 103 void ProfileLoadedCallback( | 102 void ProfileLoadedCallback( |
| 104 PlatformNotificationServiceImpl::NotificationOperation operation, | 103 PlatformNotificationServiceImpl::NotificationOperation operation, |
| 105 const GURL& origin, | 104 const GURL& origin, |
| 106 int64_t persistent_notification_id, | 105 int64_t persistent_notification_id, |
| 107 int action_index, | 106 int action_index, |
| 108 Profile* profile) { | 107 Profile* profile) { |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 538 } |
| 540 #endif | 539 #endif |
| 541 | 540 |
| 542 return base::string16(); | 541 return base::string16(); |
| 543 } | 542 } |
| 544 | 543 |
| 545 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting( | 544 void PlatformNotificationServiceImpl::SetNotificationDisplayServiceForTesting( |
| 546 NotificationDisplayService* display_service) { | 545 NotificationDisplayService* display_service) { |
| 547 test_display_service_ = display_service; | 546 test_display_service_ = display_service; |
| 548 } | 547 } |
| OLD | NEW |