summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/notification_ui_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/notifications/notification_ui_manager.cc')
-rw-r--r--chrome/browser/notifications/notification_ui_manager.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/notifications/notification_ui_manager.cc b/chrome/browser/notifications/notification_ui_manager.cc
index 6818a42..0330570 100644
--- a/chrome/browser/notifications/notification_ui_manager.cc
+++ b/chrome/browser/notifications/notification_ui_manager.cc
@@ -58,6 +58,19 @@ void NotificationUIManager::Add(const Notification& notification,
CheckAndShowNotifications();
}
+bool NotificationUIManager::Cancel(const Notification& notification) {
+ // First look through the notifications that haven't been shown. If not
+ // found there, call to the active balloon collection to tear it down.
+ NotificationDeque::iterator iter;
+ for (iter = show_queue_.begin(); iter != show_queue_.end(); ++iter) {
+ if (notification.IsSame((*iter)->notification())) {
+ show_queue_.erase(iter);
+ return true;
+ }
+ }
+ return balloon_collection_->Remove(notification);
+}
+
void NotificationUIManager::CheckAndShowNotifications() {
// TODO(johnnyg): http://crbug.com/25061 - Check for user idle/presentation.
ShowNotifications();