summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 22:45:44 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 22:45:44 +0000
commitc7127c355ca338a7f256d93196eef79033501c84 (patch)
tree95db9e59f2561842b0a5e739b6a5b08b736cb9cd /chrome/browser/tab_contents
parentba12f8f8918257976d4f7026088f4e13c07378e3 (diff)
downloadchromium_src-c7127c355ca338a7f256d93196eef79033501c84.zip
chromium_src-c7127c355ca338a7f256d93196eef79033501c84.tar.gz
chromium_src-c7127c355ca338a7f256d93196eef79033501c84.tar.bz2
Don't send resize messages until the renderer has been initialized.
1) Moves renderer_initialized_ from RenderWidgetView into RenderWidgetHost (its parent). Should be identical semantics to before. 2) Test renderer_initialized_ in RWH::WasResized(). This also reverts r13725, which was another attempt at fixing this problem. BUG=9830,10659 TEST=From the Linux start page, click a link then click back -- should not get a gray page. From Google reader, click a link (which spawns a new tab within the same process) -- should not get a gray page. Review URL: http://codereview.chromium.org/93038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14260 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents_view.h4
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.cc7
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.h2
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.h1
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.mm4
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_win.cc4
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_win.h1
-rw-r--r--chrome/browser/tab_contents/web_contents.cc2
8 files changed, 2 insertions, 23 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view.h b/chrome/browser/tab_contents/tab_contents_view.h
index 2a17dff..7095bf8 100644
--- a/chrome/browser/tab_contents/tab_contents_view.h
+++ b/chrome/browser/tab_contents/tab_contents_view.h
@@ -124,10 +124,6 @@ class TabContentsView : public RenderViewHostDelegate::View {
// invoked, SetInitialFocus is invoked.
virtual void RestoreFocus() = 0;
- // Sets children's size. May involve packing them in order to get the
- // toolkit to send them resize events.
- virtual void SetChildSize(RenderWidgetHostView* rwh_view) = 0;
-
protected:
TabContentsView() {} // Abstract interface.
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index 7262d19..6c6bc30 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -101,6 +101,7 @@ RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget(
g_signal_connect(view->native_view(), "button-press-event",
G_CALLBACK(OnMouseDown), this);
gfx::RemoveAllChildren(vbox_.get());
+ gtk_box_pack_start(GTK_BOX(vbox_.get()), content_view_, TRUE, TRUE, 0);
return view;
}
@@ -186,12 +187,6 @@ void TabContentsViewGtk::RestoreFocus() {
NOTIMPLEMENTED() << " -- need to restore the focus position on this page.";
}
-void TabContentsViewGtk::SetChildSize(RenderWidgetHostView* rwh_view) {
- // Packing the gtk widget in a container will cause a configure-event to be
- // sent to the widget.
- gtk_box_pack_start(GTK_BOX(vbox_.get()), content_view_, TRUE, TRUE, 0);
-}
-
void TabContentsViewGtk::UpdateDragCursor(bool is_drop_target) {
NOTIMPLEMENTED();
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/chrome/browser/tab_contents/tab_contents_view_gtk.h
index 94c60c4..08c4388 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.h
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.h
@@ -43,7 +43,6 @@ class TabContentsViewGtk : public TabContentsView {
virtual void SetInitialFocus();
virtual void StoreFocus();
virtual void RestoreFocus();
- virtual void SetChildSize(RenderWidgetHostView* rwh_view);
// Backend implementation of RenderViewHostDelegate::View.
virtual void ShowContextMenu(const ContextMenuParams& params);
@@ -56,7 +55,6 @@ class TabContentsViewGtk : public TabContentsView {
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update);
-
private:
// We keep track of the timestamp of the latest mousedown event.
static gboolean OnMouseDown(GtkWidget* widget,
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.h b/chrome/browser/tab_contents/tab_contents_view_mac.h
index 920fd76..ae40894 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.h
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.h
@@ -58,7 +58,6 @@ class TabContentsViewMac : public TabContentsView,
virtual void SetInitialFocus();
virtual void StoreFocus();
virtual void RestoreFocus();
- virtual void SetChildSize(RenderWidgetHostView* rwh_view);
// Backend implementation of RenderViewHostDelegate::View.
virtual RenderWidgetHostView* CreateNewWidgetInternal(int route_id,
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index 291c73c..d7e4398 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -160,10 +160,6 @@ void TabContentsViewMac::RestoreFocus() {
// TODO(port)
}
-void TabContentsViewMac::SetChildSize(RenderWidgetHostView* rwh_view) {
- rwh_view->SetSize(GetContainerSize());
-}
-
void TabContentsViewMac::UpdateDragCursor(bool is_drop_target) {
NOTIMPLEMENTED();
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_win.cc b/chrome/browser/tab_contents/tab_contents_view_win.cc
index 3278c60..f5f3d96 100644
--- a/chrome/browser/tab_contents/tab_contents_view_win.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_win.cc
@@ -310,10 +310,6 @@ void TabContentsViewWin::RestoreFocus() {
}
}
-void TabContentsViewWin::SetChildSize(RenderWidgetHostView* rwh_view) {
- rwh_view->SetSize(GetContainerSize());
-}
-
void TabContentsViewWin::UpdateDragCursor(bool is_drop_target) {
drop_target_->set_is_drop_target(is_drop_target);
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_win.h b/chrome/browser/tab_contents/tab_contents_view_win.h
index 227dfa5..8ef2765 100644
--- a/chrome/browser/tab_contents/tab_contents_view_win.h
+++ b/chrome/browser/tab_contents/tab_contents_view_win.h
@@ -43,7 +43,6 @@ class TabContentsViewWin : public TabContentsView,
virtual void SetInitialFocus();
virtual void StoreFocus();
virtual void RestoreFocus();
- virtual void SetChildSize(RenderWidgetHostView* rwh_view);
// Backend implementation of RenderViewHostDelegate::View.
virtual void ShowContextMenu(const ContextMenuParams& params);
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index 6236f6a..dcd566c 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -1559,7 +1559,7 @@ bool WebContents::CreateRenderViewForRenderManager(
return false;
// Now that the RenderView has been created, we need to tell it its size.
- view_->SetChildSize(rwh_view);
+ rwh_view->SetSize(view_->GetContainerSize());
UpdateMaxPageIDIfNecessary(render_view_host->site_instance(),
render_view_host);