OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 PaintCompositorHostWindow(hWnd); | 1507 PaintCompositorHostWindow(hWnd); |
1508 return 0; | 1508 return 0; |
1509 default: | 1509 default: |
1510 return DefWindowProc(hWnd, message, wParam, lParam); | 1510 return DefWindowProc(hWnd, message, wParam, lParam); |
1511 } | 1511 } |
1512 } | 1512 } |
1513 | 1513 |
1514 // Creates a HWND within the RenderWidgetHostView that will serve as a host | 1514 // Creates a HWND within the RenderWidgetHostView that will serve as a host |
1515 // for a HWND that the GPU process will create. The host window is used | 1515 // for a HWND that the GPU process will create. The host window is used |
1516 // to Z-position the GPU's window relative to other plugin windows. | 1516 // to Z-position the GPU's window relative to other plugin windows. |
1517 gfx::PluginWindowHandle RenderWidgetHostViewWin::AcquireCompositingSurface() { | 1517 gfx::PluginWindowHandle RenderWidgetHostViewWin::GetCompositingSurface() { |
1518 // If the window has been created, don't recreate it a second time | 1518 // If the window has been created, don't recreate it a second time |
1519 if (compositor_host_window_) | 1519 if (compositor_host_window_) |
1520 return compositor_host_window_; | 1520 return compositor_host_window_; |
1521 | 1521 |
1522 static ATOM window_class = 0; | 1522 static ATOM window_class = 0; |
1523 if (!window_class) { | 1523 if (!window_class) { |
1524 WNDCLASSEX wcex; | 1524 WNDCLASSEX wcex; |
1525 wcex.cbSize = sizeof(WNDCLASSEX); | 1525 wcex.cbSize = sizeof(WNDCLASSEX); |
1526 wcex.style = 0; | 1526 wcex.style = 0; |
1527 wcex.lpfnWndProc = | 1527 wcex.lpfnWndProc = |
(...skipping 19 matching lines...) Expand all Loading... |
1547 compositor_host_window_ = CreateWindowEx( | 1547 compositor_host_window_ = CreateWindowEx( |
1548 WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, | 1548 WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, |
1549 MAKEINTATOM(window_class), 0, | 1549 MAKEINTATOM(window_class), 0, |
1550 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_DISABLED, | 1550 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_DISABLED, |
1551 0, 0, width, height, m_hWnd, 0, GetModuleHandle(NULL), 0); | 1551 0, 0, width, height, m_hWnd, 0, GetModuleHandle(NULL), 0); |
1552 DCHECK(compositor_host_window_); | 1552 DCHECK(compositor_host_window_); |
1553 | 1553 |
1554 return static_cast<gfx::PluginWindowHandle>(compositor_host_window_); | 1554 return static_cast<gfx::PluginWindowHandle>(compositor_host_window_); |
1555 } | 1555 } |
1556 | 1556 |
1557 void RenderWidgetHostViewWin::ReleaseCompositingSurface( | |
1558 gfx::PluginWindowHandle surface) { | |
1559 ShowCompositorHostWindow(false); | |
1560 } | |
1561 | |
1562 void RenderWidgetHostViewWin::ShowCompositorHostWindow(bool show) { | 1557 void RenderWidgetHostViewWin::ShowCompositorHostWindow(bool show) { |
1563 // When we first create the compositor, we will get a show request from | 1558 // When we first create the compositor, we will get a show request from |
1564 // the renderer before we have gotten the create request from the GPU. In this | 1559 // the renderer before we have gotten the create request from the GPU. In this |
1565 // case, simply ignore the show request. | 1560 // case, simply ignore the show request. |
1566 if (compositor_host_window_ == NULL) | 1561 if (compositor_host_window_ == NULL) |
1567 return; | 1562 return; |
1568 | 1563 |
1569 if (show) { | 1564 if (show) { |
1570 UINT flags = SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | | 1565 UINT flags = SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | |
1571 SWP_NOACTIVATE | SWP_DEFERERASE | SWP_SHOWWINDOW; | 1566 SWP_NOACTIVATE | SWP_DEFERERASE | SWP_SHOWWINDOW; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 } | 1798 } |
1804 | 1799 |
1805 // static | 1800 // static |
1806 RenderWidgetHostView* | 1801 RenderWidgetHostView* |
1807 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1802 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1808 gfx::NativeView native_view) { | 1803 gfx::NativeView native_view) { |
1809 return ::IsWindow(native_view) ? | 1804 return ::IsWindow(native_view) ? |
1810 reinterpret_cast<RenderWidgetHostView*>( | 1805 reinterpret_cast<RenderWidgetHostView*>( |
1811 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1806 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
1812 } | 1807 } |
OLD | NEW |