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

Unified Diff: chrome/renderer/render_view.cc

Issue 400028: Make extension popups shrink when their contents shrink. (Closed)
Patch Set: Created 11 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 | « chrome/common/extensions/docs/examples/extensions/news/feed.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index bfc427dedb2f1fa51daf542f152f57b0a0c6b931..492823fe72c2a3238dae389e16aedc95e276cf77 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2546,14 +2546,13 @@ void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) {
// cache the width and height and only send the IPC message when we're sure
// they're different.
int width = webview()->mainFrame()->contentsPreferredWidth();
+ int height = webview()->mainFrame()->documentElementScrollHeight();
+
if (width != preferred_size_.width() ||
- size.height != preferred_size_.height()) {
+ height != preferred_size_.height()) {
preferred_size_.set_width(width);
+ preferred_size_.set_height(height);
- // TODO(erikkay) the contents size is not really the same as the
- // preferred size. It's just the current size. This means that for
- // height, it will only ever grow, it will never shrink.
- preferred_size_.set_height(size.height);
Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_,
preferred_size_));
}
« no previous file with comments | « chrome/common/extensions/docs/examples/extensions/news/feed.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698