OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_center_notification_manager.h" | 5 #include "chrome/browser/notifications/message_center_notification_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 const std::string id = curiter->first; | 271 const std::string id = curiter->first; |
272 RemoveProfileNotification(curiter->second); | 272 RemoveProfileNotification(curiter->second); |
273 message_center_->RemoveNotification(id, /* by_user */ false); | 273 message_center_->RemoveNotification(id, /* by_user */ false); |
274 removed = true; | 274 removed = true; |
275 } | 275 } |
276 } | 276 } |
277 return removed; | 277 return removed; |
278 } | 278 } |
279 | 279 |
280 void MessageCenterNotificationManager::CancelAll() { | 280 void MessageCenterNotificationManager::CancelAll() { |
281 message_center_->RemoveAllNotifications(/* by_user */ false); | 281 message_center_->RemoveAllNotifications( |
| 282 false /* by_user */, message_center::MessageCenter::RemoveType::ALL); |
282 } | 283 } |
283 | 284 |
284 //////////////////////////////////////////////////////////////////////////////// | 285 //////////////////////////////////////////////////////////////////////////////// |
285 // MessageCenter::Observer | 286 // MessageCenter::Observer |
286 void MessageCenterNotificationManager::OnNotificationRemoved( | 287 void MessageCenterNotificationManager::OnNotificationRemoved( |
287 const std::string& id, | 288 const std::string& id, |
288 bool by_user) { | 289 bool by_user) { |
289 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 290 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
290 if (iter != profile_notifications_.end()) | 291 if (iter != profile_notifications_.end()) |
291 RemoveProfileNotification(iter->second); | 292 RemoveProfileNotification(iter->second); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 it != registry->enabled_extensions().end(); | 386 it != registry->enabled_extensions().end(); |
386 ++it) { | 387 ++it) { |
387 if ((*it->get()).permissions_data()->HasAPIPermission( | 388 if ((*it->get()).permissions_data()->HasAPIPermission( |
388 extensions::APIPermission::ID::kNotificationProvider)) { | 389 extensions::APIPermission::ID::kNotificationProvider)) { |
389 extension_id = (*it->get()).id(); | 390 extension_id = (*it->get()).id(); |
390 return extension_id; | 391 return extension_id; |
391 } | 392 } |
392 } | 393 } |
393 return extension_id; | 394 return extension_id; |
394 } | 395 } |
OLD | NEW |