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

Unified Diff: chrome/browser/notifications/balloon.cc

Issue 5361006: For OSX, make it so that notifications only start resizing after the first paint is done. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser
Patch Set: Fix ifdef. 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
« no previous file with comments | « no previous file | chrome/browser/notifications/balloon_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | chrome/browser/notifications/balloon_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698