Index: chrome/browser/notifications/balloon.cc |
diff --git a/chrome/browser/notifications/balloon.cc b/chrome/browser/notifications/balloon.cc |
index 96f3fca7b4f3668702e8d9df02ccae61252a1c04..ea12e4368c69cd9e47bee94e20243939f8847cc2 100644 |
--- a/chrome/browser/notifications/balloon.cc |
+++ b/chrome/browser/notifications/balloon.cc |
@@ -9,6 +9,7 @@ |
#include "chrome/browser/notifications/notification.h" |
#include "chrome/browser/renderer_host/site_instance.h" |
#include "gfx/rect.h" |
+#include "gfx/size.h" |
Balloon::Balloon(const Notification& notification, Profile* profile, |
BalloonCollection* collection) |
@@ -27,7 +28,18 @@ void Balloon::SetPosition(const gfx::Point& upper_left, bool reposition) { |
} |
void Balloon::SetContentPreferredSize(const gfx::Size& size) { |
- collection_->ResizeBalloon(this, size); |
+ gfx::Size new_size(size); |
+#if defined(OS_MACOSX) |
John Gregg
2010/11/30 00:25:22
add comment with a TODO and bug # about making thi
|
+ // Only allow the size of notifications to grow. This stops the balloon |
+ // from jumping between sizes due to dynamic content. For example, the |
+ // balloon's contents may adjust due to changes in |
+ // document.body.clientHeight. |
+ new_size.set_height(std::max(new_size.height(), content_size_.height())); |
+ |
+ if (content_size_ == new_size) |
+ return; |
+#endif |
+ collection_->ResizeBalloon(this, new_size); |
} |
void Balloon::set_view(BalloonView* balloon_view) { |