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

Unified Diff: chrome/browser/tab_contents/tab_contents_view_gtk.cc

Issue 214002: Resize the render widget host even if the widget is hidden. (Closed)
Patch Set: set size Created 11 years, 3 months 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/browser/tab_contents/tab_contents_view_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents_view_gtk.cc
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index 1eaaf4eec1605639e5d2626b4deeaf872e64a7f7..6326ae19dc1fb97765389d4692816a4456d79886 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -476,7 +476,7 @@ void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const {
if (fixed_->window)
gdk_window_get_origin(fixed_->window, &x, &y);
out->SetRect(x + fixed_->allocation.x, y + fixed_->allocation.y,
- fixed_->allocation.width, fixed_->allocation.height);
+ requested_size_.width(), requested_size_.height());
}
void TabContentsViewGtk::OnContentsDestroy() {
@@ -501,19 +501,12 @@ void TabContentsViewGtk::OnTabCrashed() {
}
void TabContentsViewGtk::SizeContents(const gfx::Size& size) {
- // We don't normally need to manually set the size of of widgets in GTK+,
- // but this is used when creating background tabs. When a tab is created in
- // the background, we need to set the size so WebKit can properly compute
- // the scrolling offset if a #ref is provided.
- if (tab_contents()->render_widget_host_view()) {
- GtkWidget* widget =
- tab_contents()->render_widget_host_view()->GetNativeView();
- // During unit tests, |widget| can be NULL.
- if (widget) {
- widget->allocation.width = size.width();
- widget->allocation.height = size.height();
- }
- }
+ // We don't need to manually set the size of of widgets in GTK+, but we do
+ // need to pass the sizing information on to the RWHV which will pass the
+ // sizing information on to the renderer.
+ requested_size_ = size;
+ if (tab_contents()->render_widget_host_view())
+ tab_contents()->render_widget_host_view()->SetSize(size);
}
void TabContentsViewGtk::Focus() {
@@ -635,6 +628,8 @@ gboolean TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget,
TabContentsViewGtk* view) {
int width = allocation->width;
int height = allocation->height;
+ view->requested_size_.set_width(width);
+ view->requested_size_.set_height(height);
// |delegate()| can be NULL here during browser teardown.
if (view->tab_contents()->delegate())
height += view->tab_contents()->delegate()->GetExtraRenderViewHeight();
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_view_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698