Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1301)

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 6024008: Consider the popup window position when the window shows upward. This patch depends on WebKit patch. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix Mac, and change rwhv according to the move. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 45714a27d26282d6bb83bc7d74235d50238e1ebf..b2614c349a0d704a84443bf61765f4569200e3ca 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -366,19 +366,27 @@ 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();
+ SetWindowPos(NULL, rect.x(), rect.y(), rect.width(),
+ rect.height(), swp_flags);
if (compositor_host_window_) {
::SetWindowPos(compositor_host_window_,
NULL,
- 0, 0,
- size.width(), size.height(),
+ rect.x(), rect.y(),
+ rect.width(), rect.height(),
SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE);
}
render_widget_host_->WasResized();

Powered by Google App Engine
This is Rietveld 408576698