diff options
author | dpolukhin@google.com <dpolukhin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 10:39:19 +0000 |
---|---|---|
committer | dpolukhin@google.com <dpolukhin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 10:39:19 +0000 |
commit | e069739561c16092f24df33eafd54f8ab9e5697f (patch) | |
tree | 15e4b54e9f7271e8c6c5e3229d1a99375931139f /chrome | |
parent | acb6ac9a1e305d0100081c145cda5dd0182b597e (diff) | |
download | chromium_src-e069739561c16092f24df33eafd54f8ab9e5697f.zip chromium_src-e069739561c16092f24df33eafd54f8ab9e5697f.tar.gz chromium_src-e069739561c16092f24df33eafd54f8ab9e5697f.tar.bz2 |
Return back all changes in tab_contents_view_win.cc about root view layout.
BUG=37533,36280
TEST=In RTL layout drop down menues should be within Chrome window.
Review URL: http://codereview.chromium.org/782006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/tab_contents/tab_contents_view_win.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/views/tab_contents/tab_contents_view_win.cc index d1c3bfe..5af44c6 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc +++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc @@ -171,7 +171,11 @@ void TabContentsViewWin::OnTabCrashed() { void TabContentsViewWin::SizeContents(const gfx::Size& size) { // TODO(brettw) this is a hack and should be removed. See tab_contents_view.h. - WasSized(size); + + // Set new window size. It will fire OnWindowPosChanged and we will do + // the rest in WasSized. + UINT swp_flags = SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE; + SetWindowPos(NULL, 0, 0, size.width(), size.height(), swp_flags); } void TabContentsViewWin::Focus() { @@ -451,7 +455,12 @@ void TabContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) { } void TabContentsViewWin::OnSize(UINT param, const CSize& size) { - WidgetWin::OnSize(param, size); + // NOTE: Because TabContentsViewWin handles OnWindowPosChanged without calling + // DefWindowProc, OnSize is NOT called on window resize. This handler + // is called only once when the window is created. + + // Don't call base class OnSize to avoid useless layout for 0x0 size. + // We will get OnWindowPosChanged later and layout root view in WasSized. // Hack for thinkpad touchpad driver. // Set fake scrollbars so that we can get scroll messages, @@ -502,13 +511,17 @@ void TabContentsViewWin::WasShown() { } void TabContentsViewWin::WasSized(const gfx::Size& size) { - UINT swp_flags = SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE; - SetWindowPos(NULL, 0, 0, size.width(), size.height(), swp_flags); if (tab_contents()->interstitial_page()) tab_contents()->interstitial_page()->SetSize(size); RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); if (rwhv) rwhv->SetSize(size); + + // We have to layout root view here because we handle OnWindowPosChanged + // without calling DefWindowProc (it sends OnSize and OnMove) so we don't + // receive OnSize. For performance reasons call SetBounds instead of + // LayoutRootView, we actually don't need paint event and we know new size. + GetRootView()->SetBounds(0, 0, size.width(), size.height()); } bool TabContentsViewWin::ScrollZoom(int scroll_type) { |