Chromium Code Reviews| Index: chrome/browser/renderer_host/render_widget_host_view_win.cc |
| diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc |
| index 459b9e526afd63692b4551d1c752b617dc0d1ed7..3581e186e0d24cd518b0ba26b8a43f2354b2780c 100644 |
| --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc |
| +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc |
| @@ -367,19 +367,29 @@ void RenderWidgetHostViewWin::WasHidden() { |
| } |
| void RenderWidgetHostViewWin::SetSize(const gfx::Size& size) { |
| + gfx::Rect rect = GetViewBounds(); |
| + rect.set_size(size); |
| + SetBounds(rect); |
| +} |
| + |
| +void RenderWidgetHostViewWin::SetBounds(const gfx::Rect& rect) { |
| if (is_hidden_) |
| return; |
| - // No SWP_NOREDRAW as autofill popups can resize and the underneath window |
| + // No SWP_NOREDRAW as autofill popups can move and the underneath window |
| // should redraw in that case. |
| UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | |
| - SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
| - SetWindowPos(NULL, 0, 0, size.width(), size.height(), swp_flags); |
| + SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
| + gfx::Rect org_rect = GetViewBounds(); |
| + if (rect.origin() == org_rect.orgin()) |
|
Peter Kasting
2011/02/16 22:01:25
Nit: I don't think you need this conditional. SWP
|
| + swp_flags |= SWP_NOMOVE; |
| + SetWindowPos(NULL, point.x(), point.y(), window_rect.Width(), |
|
Peter Kasting
2011/02/16 22:01:25
You need to change both |point| and |window_rect|
|
| + window_rect.Height(), swp_flags); |
| if (compositor_host_window_) { |
| ::SetWindowPos(compositor_host_window_, |
| NULL, |
| - 0, 0, |
| - size.width(), size.height(), |
| + point.x(), point.y(), |
| + rect.Width(), rect.Height(), |
| SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); |
| } |
| render_widget_host_->WasResized(); |