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

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

Issue 5319011: Listen for APP_TERMINATING in notification ui; close windows earlier in the p... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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.h
===================================================================
--- chrome/browser/notifications/notification_ui_manager.h (revision 67750)
+++ chrome/browser/notifications/notification_ui_manager.h (working copy)
@@ -13,6 +13,8 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/notifications/balloon.h"
#include "chrome/browser/notifications/balloon_collection.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
class Notification;
class Profile;
@@ -22,7 +24,8 @@
// The notification manager manages use of the desktop for notifications.
// It maintains a queue of pending notifications when space becomes constrained.
class NotificationUIManager
- : public BalloonCollection::BalloonSpaceChangeListener {
+ : public BalloonCollection::BalloonSpaceChangeListener,
+ public NotificationObserver {
public:
NotificationUIManager();
virtual ~NotificationUIManager();
@@ -53,11 +56,20 @@
// queue. Returns true if anything was removed.
virtual bool CancelAllBySourceOrigin(const GURL& source_origin);
+ // Cancels all pending notifications and closes anything currently showing.
+ // Used when the app is terminating.
+ void CancelAll();
+
// Returns balloon collection.
BalloonCollection* balloon_collection() {
return balloon_collection_.get();
}
+ // NotificationObserver interface (the event signaling kind of notifications)
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
private:
// Attempts to display notifications from the show_queue if the user
// is active.
@@ -80,6 +92,9 @@
typedef std::deque<QueuedNotification*> NotificationDeque;
NotificationDeque show_queue_;
+ // Registrar for the other kind of notifications (event signaling).
+ NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(NotificationUIManager);
};

Powered by Google App Engine
This is Rietveld 408576698