summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications/balloon.cc
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.cc
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.cc')
-rw-r--r--chrome/browser/notifications/balloon.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/notifications/balloon.cc b/chrome/browser/notifications/balloon.cc
index d9d4c1f..da49395 100644
--- a/chrome/browser/notifications/balloon.cc
+++ b/chrome/browser/notifications/balloon.cc
@@ -10,10 +10,10 @@
#include "chrome/browser/renderer_host/site_instance.h"
Balloon::Balloon(const Notification& notification, Profile* profile,
- BalloonCloseListener* listener)
+ BalloonCollection* collection)
: profile_(profile),
notification_(notification),
- close_listener_(listener) {
+ collection_(collection) {
}
Balloon::~Balloon() {
@@ -25,6 +25,10 @@ void Balloon::SetPosition(const gfx::Point& upper_left, bool reposition) {
balloon_view_->RepositionToBalloon();
}
+void Balloon::SetContentPreferredSize(const gfx::Size& size) {
+ collection_->ResizeBalloon(this, size);
+}
+
void Balloon::set_view(BalloonView* balloon_view) {
balloon_view_.reset(balloon_view);
}
@@ -38,8 +42,7 @@ void Balloon::Show() {
void Balloon::OnClose(bool by_user) {
notification_.Close(by_user);
- if (close_listener_)
- close_listener_->OnBalloonClosed(this);
+ collection_->OnBalloonClosed(this);
}
void Balloon::CloseByScript() {