summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/balloon_collection_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/notifications/balloon_collection_impl.h')
-rw-r--r--chrome/browser/notifications/balloon_collection_impl.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/chrome/browser/notifications/balloon_collection_impl.h b/chrome/browser/notifications/balloon_collection_impl.h
index 3596a25..a9c7afc 100644
--- a/chrome/browser/notifications/balloon_collection_impl.h
+++ b/chrome/browser/notifications/balloon_collection_impl.h
@@ -13,7 +13,6 @@
#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"
@@ -42,13 +41,14 @@ class BalloonCollectionImpl : public BalloonCollection
// BalloonCollection interface.
virtual void Add(const Notification& notification,
Profile* profile);
- virtual bool RemoveById(const std::string& id);
- virtual bool RemoveBySourceOrigin(const GURL& source_origin);
+ virtual bool Remove(const Notification& notification);
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 base_.balloons(); }
+ virtual const Balloons& GetActiveBalloons() {
+ return balloons_;
+ }
// MessageLoopForUI::Observer interface.
#if defined(OS_WIN)
@@ -135,6 +135,9 @@ class BalloonCollectionImpl : public BalloonCollection
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);
@@ -147,12 +150,6 @@ class BalloonCollectionImpl : public BalloonCollection
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();
@@ -166,7 +163,16 @@ class BalloonCollectionImpl : public BalloonCollection
// 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_;