OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "chrome/browser/notifications/message_center_display_service.h" | 8 #include "chrome/browser/notifications/message_center_display_service.h" |
9 | 9 |
10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 void MessageCenterDisplayService::Close( | 32 void MessageCenterDisplayService::Close( |
33 NotificationCommon::Type notification_type, | 33 NotificationCommon::Type notification_type, |
34 const std::string& notification_id) { | 34 const std::string& notification_id) { |
35 ui_manager_->CancelById(notification_id, | 35 ui_manager_->CancelById(notification_id, |
36 NotificationUIManager::GetProfileID(profile_)); | 36 NotificationUIManager::GetProfileID(profile_)); |
37 } | 37 } |
38 | 38 |
39 void MessageCenterDisplayService::GetDisplayed( | 39 void MessageCenterDisplayService::GetDisplayed( |
40 const DisplayedNotificationsCallback& callback) const { | 40 const DisplayedNotificationsCallback& callback) { |
41 auto displayed_notifications = | 41 auto displayed_notifications = |
42 base::MakeUnique<std::set<std::string>>(ui_manager_->GetAllIdsByProfile( | 42 base::MakeUnique<std::set<std::string>>(ui_manager_->GetAllIdsByProfile( |
43 NotificationUIManager::GetProfileID(profile_))); | 43 NotificationUIManager::GetProfileID(profile_))); |
44 | 44 |
45 content::BrowserThread::PostTask( | 45 content::BrowserThread::PostTask( |
46 content::BrowserThread::UI, FROM_HERE, | 46 content::BrowserThread::UI, FROM_HERE, |
47 base::Bind(callback, base::Passed(&displayed_notifications), | 47 base::Bind(callback, base::Passed(&displayed_notifications), |
48 true /* supports_synchronization */)); | 48 true /* supports_synchronization */)); |
49 } | 49 } |
OLD | NEW |