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

Unified Diff: chrome/browser/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/notifications/balloon_collection_impl.h
===================================================================
--- chrome/browser/notifications/balloon_collection_impl.h (revision 66634)
+++ chrome/browser/notifications/balloon_collection_impl.h (working copy)
@@ -13,6 +13,7 @@
#include "base/basictypes.h"
#include "base/message_loop.h"
#include "chrome/browser/notifications/balloon_collection.h"
+#include "chrome/browser/notifications/balloon_collection_base.h"
#include "gfx/point.h"
#include "gfx/rect.h"
@@ -41,14 +42,13 @@
// BalloonCollection interface.
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& source_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(); }
// MessageLoopForUI::Observer interface.
#if defined(OS_WIN)
@@ -135,9 +135,6 @@
Profile* profile);
private:
- // The number of balloons being displayed.
- int count() const { return balloons_.size(); }
-
// Adjusts the positions of the balloons (e.g., when one is closed).
// Implemented by each platform for specific UI requirements.
void PositionBalloons(bool is_reposition);
@@ -150,6 +147,12 @@
static gfx::Rect GetMacWorkArea();
#endif
+ // Base implementation for the collection of active balloons.
+ BalloonCollectionBase base_;
+
+ // The layout parameters for balloons in this collection.
+ Layout layout_;
+
#if USE_OFFSETS
// Start and stop observing all UI events.
void AddMessageLoopObserver();
@@ -163,16 +166,7 @@
// Is the current cursor in the balloon area?
bool IsCursorInBalloonCollection() const;
-#endif
- // Queue of active balloons.
- typedef std::deque<Balloon*> Balloons;
- Balloons balloons_;
-
- // The layout parameters for balloons in this collection.
- Layout layout_;
-
-#if USE_OFFSETS
// Factory for generating delayed reposition tasks on mouse motion.
ScopedRunnableMethodFactory<BalloonCollectionImpl> reposition_factory_;
« no previous file with comments | « chrome/browser/notifications/balloon_collection.cc ('k') | chrome/browser/notifications/balloon_collection_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698