Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: chrome/browser/notifications/notification_ui_manager.cc

Issue 363003: Implement cancel() API on a Notification object so that script can cancel or ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_ui_manager.cc
===================================================================
--- chrome/browser/notifications/notification_ui_manager.cc (revision 30967)
+++ chrome/browser/notifications/notification_ui_manager.cc (working copy)
@@ -58,6 +58,18 @@
CheckAndShowNotifications();
}
+bool NotificationUIManager::Cancel(const Notification& notification) {
+ // First look through the notifications that haven't been shown.
+ 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();
« no previous file with comments | « chrome/browser/notifications/notification_ui_manager.h ('k') | chrome/browser/renderer_host/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698