summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/balloon_collection.h
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 19:49:56 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 19:49:56 +0000
commitd42d02c4a7ea5fd8781af7a67d9ac186d0ee0db5 (patch)
tree0dea8cb5c6ee1216a0651b2dea603f0042759b06 /chrome/browser/notifications/balloon_collection.h
parentcad4da4151f41c6203a9fe502fb818bab7e4862a (diff)
downloadchromium_src-d42d02c4a7ea5fd8781af7a67d9ac186d0ee0db5.zip
chromium_src-d42d02c4a7ea5fd8781af7a67d9ac186d0ee0db5.tar.gz
chromium_src-d42d02c4a7ea5fd8781af7a67d9ac186d0ee0db5.tar.bz2
Notifications should resize themselves to the content within min-max bounds, rather than being all the same size.
CL hooks into RenderView callbacks to detect the size of the content, and contains some refactoring so that conceptually balloon size = content size + frame, rather than content size = balloon size - frame as it has been. BUG=26691 TEST=included Review URL: http://codereview.chromium.org/460131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/balloon_collection.h')
-rw-r--r--chrome/browser/notifications/balloon_collection.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/notifications/balloon_collection.h b/chrome/browser/notifications/balloon_collection.h
index 918f993..8810b18 100644
--- a/chrome/browser/notifications/balloon_collection.h
+++ b/chrome/browser/notifications/balloon_collection.h
@@ -32,14 +32,19 @@ class BalloonCollection {
// Is there room to add another notification?
virtual bool HasSpace() const = 0;
+
+ // Request the resizing of a balloon.
+ virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) = 0;
+
+ // Inform the collection that a balloon was closed.
+ virtual void OnBalloonClosed(Balloon* source) = 0;
};
// A balloon collection represents a set of notification balloons being
// shown on the screen. It positions new notifications according to
// a layout, and monitors for balloons being closed, which it reports
// up to its parent, the notification UI manager.
-class BalloonCollectionImpl : public BalloonCollection,
- public Balloon::BalloonCloseListener {
+class BalloonCollectionImpl : public BalloonCollection {
public:
class BalloonSpaceChangeListener {
public:
@@ -65,8 +70,7 @@ class BalloonCollectionImpl : public BalloonCollection,
Profile* profile);
virtual bool Remove(const Notification& notification);
virtual bool HasSpace() const;
-
- // Balloon::BalloonCloseListener interface
+ virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size);
virtual void OnBalloonClosed(Balloon* source);
protected:
@@ -117,10 +121,10 @@ class BalloonCollectionImpl : public BalloonCollection,
VERTICALLY_FROM_BOTTOM_RIGHT
};
- // Minimum and maximum size of balloon
+ // Minimum and maximum size of balloon content.
static const int kBalloonMinWidth = 300;
static const int kBalloonMaxWidth = 300;
- static const int kBalloonMinHeight = 90;
+ static const int kBalloonMinHeight = 48;
static const int kBalloonMaxHeight = 120;
static Placement placement_;