summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_view_win.cc20
1 files changed, 4 insertions, 16 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 9161668..d1c3bfe 100644
--- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc
+++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc
@@ -171,11 +171,7 @@ 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.
-
- // 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);
+ WasSized(size);
}
void TabContentsViewWin::Focus() {
@@ -455,12 +451,7 @@ void TabContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) {
}
void TabContentsViewWin::OnSize(UINT param, const CSize& 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.
+ WidgetWin::OnSize(param, size);
// Hack for thinkpad touchpad driver.
// Set fake scrollbars so that we can get scroll messages,
@@ -511,16 +502,13 @@ 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.
- LayoutRootView();
}
bool TabContentsViewWin::ScrollZoom(int scroll_type) {