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

Side by Side 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 formats. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 // reduce its resource utilization. 359 // reduce its resource utilization.
360 render_widget_host_->WasHidden(); 360 render_widget_host_->WasHidden();
361 361
362 // TODO(darin): what about constrained windows? it doesn't look like they 362 // TODO(darin): what about constrained windows? it doesn't look like they
363 // see a message when their parent is hidden. maybe there is something more 363 // see a message when their parent is hidden. maybe there is something more
364 // generic we can do at the TabContents API level instead of relying on 364 // generic we can do at the TabContents API level instead of relying on
365 // Windows messages. 365 // Windows messages.
366 } 366 }
367 367
368 void RenderWidgetHostViewWin::SetSize(const gfx::Size& size) { 368 void RenderWidgetHostViewWin::SetSize(const gfx::Size& size) {
369 gfx::Rect rect = GetViewBounds();
Peter Kasting 2011/02/24 18:34:21 Nit: I just realized this function could be simple
honten.org 2011/02/25 01:15:37 Done.
370 rect.set_size(size);
371 SetBounds(rect);
372 }
373
374 void RenderWidgetHostViewWin::SetBounds(const gfx::Rect& rect) {
369 if (is_hidden_) 375 if (is_hidden_)
370 return; 376 return;
371 377
372 // No SWP_NOREDRAW as autofill popups can resize and the underneath window 378 // No SWP_NOREDRAW as autofill popups can move and the underneath window
373 // should redraw in that case. 379 // should redraw in that case.
374 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | 380 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS |
375 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; 381 SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE;
376 SetWindowPos(NULL, 0, 0, size.width(), size.height(), swp_flags); 382 gfx::Rect org_rect = GetViewBounds();
Peter Kasting 2011/02/24 18:34:21 Nit: This is unused, delete it
honten.org 2011/02/25 01:15:37 Done.
383 SetWindowPos(NULL, rect.x(), rect.y(), rect.width(), rect.height(),
384 swp_flags);
377 if (compositor_host_window_) { 385 if (compositor_host_window_) {
378 ::SetWindowPos(compositor_host_window_, 386 ::SetWindowPos(compositor_host_window_, NULL, rect.x(), rect.y(),
379 NULL, 387 rect.width(), rect.height(),
380 0, 0,
381 size.width(), size.height(),
382 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); 388 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE);
383 } 389 }
384 render_widget_host_->WasResized(); 390 render_widget_host_->WasResized();
385 EnsureTooltip(); 391 EnsureTooltip();
386 } 392 }
387 393
388 gfx::NativeView RenderWidgetHostViewWin::GetNativeView() { 394 gfx::NativeView RenderWidgetHostViewWin::GetNativeView() {
389 return m_hWnd; 395 return m_hWnd;
390 } 396 }
391 397
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 } 1826 }
1821 1827
1822 // static 1828 // static
1823 RenderWidgetHostView* 1829 RenderWidgetHostView*
1824 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( 1830 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView(
1825 gfx::NativeView native_view) { 1831 gfx::NativeView native_view) {
1826 return ::IsWindow(native_view) ? 1832 return ::IsWindow(native_view) ?
1827 reinterpret_cast<RenderWidgetHostView*>( 1833 reinterpret_cast<RenderWidgetHostView*>(
1828 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; 1834 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL;
1829 } 1835 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.h ('k') | chrome/browser/renderer_host/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698