summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tab_contents
diff options
context:
space:
mode:
authordpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 22:36:06 +0000
committerdpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 22:36:06 +0000
commit4cf663500e2f19560e73c5bea0e6560dbe700f2a (patch)
tree6a5e4bf24708c77d93069c7e832ee1fe5c295aab /chrome/browser/views/tab_contents
parent562ebcf98f5f03f6352a5c8af3e93d59b68baf51 (diff)
downloadchromium_src-4cf663500e2f19560e73c5bea0e6560dbe700f2a.zip
chromium_src-4cf663500e2f19560e73c5bea0e6560dbe700f2a.tar.gz
chromium_src-4cf663500e2f19560e73c5bea0e6560dbe700f2a.tar.bz2
Remember initial size of new created tab content and use it when GTK widget size is not available.
BUG=33440 TEST=On Chrome OS duplicate tab context menu, new created tab content should be visible. Review URL: http://codereview.chromium.org/606058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tab_contents')
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_view_gtk.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
index 73ad43b..b38cda9 100644
--- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
@@ -149,6 +149,8 @@ void TabContentsViewGtk::CreateView(const gfx::Size& initial_size) {
set_delete_on_destroy(false);
WidgetGtk::Init(NULL, gfx::Rect(0, 0, initial_size.width(),
initial_size.height()));
+ // WidgetGtk::Init doesn't set initial size so remember it here.
+ size_ = initial_size;
// We need to own the widget in order to attach/detach the native view
// to container.
gtk_object_ref(GTK_OBJECT(GetNativeView()));
@@ -216,6 +218,10 @@ void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const {
// during init callers expect 0x0, but Gtk layout enforces a min size of 1x1.
out->set_width(GetNativeView()->requisition.width);
out->set_height(GetNativeView()->requisition.height);
+
+ // Return initial size if window is not visible yet.
+ if (out->IsEmpty())
+ out->set_size(size_);
}
void TabContentsViewGtk::StartDragging(const WebDropData& drop_data,