OLD | NEW |
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 ::SetWindowPos(compositor_host_window_, | 379 ::SetWindowPos(compositor_host_window_, |
380 NULL, | 380 NULL, |
381 0, 0, | 381 0, 0, |
382 size.width(), size.height(), | 382 size.width(), size.height(), |
383 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); | 383 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); |
384 } | 384 } |
385 render_widget_host_->WasResized(); | 385 render_widget_host_->WasResized(); |
386 EnsureTooltip(); | 386 EnsureTooltip(); |
387 } | 387 } |
388 | 388 |
| 389 void RenderWidgetHostViewWin::MoveTo(const gfx::Point& point) { |
| 390 if (is_hidden_) |
| 391 return; |
| 392 |
| 393 // No SWP_NOREDRAW as autofill popups can move and the underneath window |
| 394 // should redraw in that case. |
| 395 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | |
| 396 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
| 397 CRect window_rect; |
| 398 GetWindowRect(&window_rect); |
| 399 int x = point.x() - window_rect.left; |
| 400 int y = point.y() - window_rect.top; |
| 401 SetWindowPos(NULL, x, y, window_rect.Width(), window_rect.Height(), |
| 402 swp_flags); |
| 403 if (compositor_host_window_) { |
| 404 ::SetWindowPos(compositor_host_window_, |
| 405 NULL, |
| 406 x, y, |
| 407 window_rect.Width(), window_rect.Height(), |
| 408 SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); |
| 409 } |
| 410 } |
| 411 |
389 gfx::NativeView RenderWidgetHostViewWin::GetNativeView() { | 412 gfx::NativeView RenderWidgetHostViewWin::GetNativeView() { |
390 return m_hWnd; | 413 return m_hWnd; |
391 } | 414 } |
392 | 415 |
393 void RenderWidgetHostViewWin::MovePluginWindows( | 416 void RenderWidgetHostViewWin::MovePluginWindows( |
394 const std::vector<WebPluginGeometry>& plugin_window_moves) { | 417 const std::vector<WebPluginGeometry>& plugin_window_moves) { |
395 if (plugin_window_moves.empty()) | 418 if (plugin_window_moves.empty()) |
396 return; | 419 return; |
397 | 420 |
398 bool oop_plugins = | 421 bool oop_plugins = |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 } | 1830 } |
1808 | 1831 |
1809 // static | 1832 // static |
1810 RenderWidgetHostView* | 1833 RenderWidgetHostView* |
1811 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1834 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1812 gfx::NativeView native_view) { | 1835 gfx::NativeView native_view) { |
1813 return ::IsWindow(native_view) ? | 1836 return ::IsWindow(native_view) ? |
1814 reinterpret_cast<RenderWidgetHostView*>( | 1837 reinterpret_cast<RenderWidgetHostView*>( |
1815 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1838 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
1816 } | 1839 } |
OLD | NEW |