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

Unified Diff: chrome/browser/chromeos/notifications/balloon_collection_impl.h

Issue 4635007: When an extension is uninstalled, close all desktop notifications from that e... (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/chromeos/notifications/balloon_collection_impl.h
===================================================================
--- chrome/browser/chromeos/notifications/balloon_collection_impl.h (revision 66634)
+++ chrome/browser/chromeos/notifications/balloon_collection_impl.h (working copy)
@@ -12,6 +12,7 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/chromeos/notifications/balloon_view_host.h"
#include "chrome/browser/notifications/balloon_collection.h"
+#include "chrome/browser/notifications/balloon_collection_base.h"
#include "chrome/common/notification_registrar.h"
#include "gfx/point.h"
#include "gfx/rect.h"
@@ -60,12 +61,13 @@
// BalloonCollectionInterface overrides
virtual void Add(const Notification& notification,
Profile* profile);
- virtual bool Remove(const Notification& notification);
+ virtual bool RemoveById(const std::string& id);
+ virtual bool RemoveBySourceOrigin(const GURL& origin);
virtual bool HasSpace() const;
virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size);
virtual void DisplayChanged() {}
virtual void OnBalloonClosed(Balloon* source);
- virtual const Balloons& GetActiveBalloons() { return balloons_; }
+ virtual const Balloons& GetActiveBalloons() { return base_.balloons(); }
// NotificationObserver overrides:
virtual void Observe(NotificationType type,
@@ -115,20 +117,19 @@
virtual Balloon* MakeBalloon(const Notification& notification,
Profile* profile);
+ // Base implementation for the collection of active balloons.
+ BalloonCollectionBase base_;
+
private:
friend class NotificationPanelTester;
// Shutdown the notification ui.
void Shutdown();
- // The number of balloons being displayed.
- int count() const { return balloons_.size(); }
+ Balloon* FindBalloon(const Notification& notification) {
+ return base_.FindBalloon(notification);
+ }
- Balloons::iterator FindBalloon(const Notification& notification);
-
- // Queue of active balloons.
- Balloons balloons_;
-
scoped_ptr<NotificationUI> notification_ui_;
NotificationRegistrar registrar_;

Powered by Google App Engine
This is Rietveld 408576698