| 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" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 13 #include "base/scoped_comptr_win.h" | 13 #include "base/scoped_comptr_win.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "base/win/scoped_gdi_object.h" | 15 #include "base/win/scoped_gdi_object.h" |
| 16 #include "base/win/wrapped_window_proc.h" |
| 16 #include "chrome/browser/accessibility/browser_accessibility_manager.h" | 17 #include "chrome/browser/accessibility/browser_accessibility_manager.h" |
| 17 #include "chrome/browser/accessibility/browser_accessibility_state.h" | 18 #include "chrome/browser/accessibility/browser_accessibility_state.h" |
| 18 #include "chrome/browser/accessibility/browser_accessibility_win.h" | 19 #include "chrome/browser/accessibility/browser_accessibility_win.h" |
| 19 #include "chrome/browser/browser_trial.h" | 20 #include "chrome/browser/browser_trial.h" |
| 20 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
| 21 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 22 #include "chrome/common/native_web_keyboard_event.h" | 23 #include "chrome/common/native_web_keyboard_event.h" |
| 23 #include "chrome/common/plugin_messages.h" | 24 #include "chrome/common/plugin_messages.h" |
| 24 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
| 25 #include "content/browser/browser_thread.h" | 26 #include "content/browser/browser_thread.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 496 |
| 496 ::EndDeferWindowPos(defer_window_pos_info); | 497 ::EndDeferWindowPos(defer_window_pos_info); |
| 497 } | 498 } |
| 498 | 499 |
| 499 HWND RenderWidgetHostViewWin::ReparentWindow(HWND window) { | 500 HWND RenderWidgetHostViewWin::ReparentWindow(HWND window) { |
| 500 static ATOM window_class = 0; | 501 static ATOM window_class = 0; |
| 501 if (!window_class) { | 502 if (!window_class) { |
| 502 WNDCLASSEX wcex; | 503 WNDCLASSEX wcex; |
| 503 wcex.cbSize = sizeof(WNDCLASSEX); | 504 wcex.cbSize = sizeof(WNDCLASSEX); |
| 504 wcex.style = CS_DBLCLKS; | 505 wcex.style = CS_DBLCLKS; |
| 505 wcex.lpfnWndProc = PluginWrapperWindowProc; | 506 wcex.lpfnWndProc = base::win::WrappedWindowProc<PluginWrapperWindowProc>; |
| 506 wcex.cbClsExtra = 0; | 507 wcex.cbClsExtra = 0; |
| 507 wcex.cbWndExtra = 0; | 508 wcex.cbWndExtra = 0; |
| 508 wcex.hInstance = GetModuleHandle(NULL); | 509 wcex.hInstance = GetModuleHandle(NULL); |
| 509 wcex.hIcon = 0; | 510 wcex.hIcon = 0; |
| 510 wcex.hCursor = 0; | 511 wcex.hCursor = 0; |
| 511 wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW+1); | 512 wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW+1); |
| 512 wcex.lpszMenuName = 0; | 513 wcex.lpszMenuName = 0; |
| 513 wcex.lpszClassName = webkit::npapi::kWrapperNativeWindowClassName; | 514 wcex.lpszClassName = webkit::npapi::kWrapperNativeWindowClassName; |
| 514 wcex.hIconSm = 0; | 515 wcex.hIconSm = 0; |
| 515 window_class = RegisterClassEx(&wcex); | 516 window_class = RegisterClassEx(&wcex); |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 gfx::PluginWindowHandle RenderWidgetHostViewWin::AcquireCompositingSurface() { | 1577 gfx::PluginWindowHandle RenderWidgetHostViewWin::AcquireCompositingSurface() { |
| 1577 // If the window has been created, don't recreate it a second time | 1578 // If the window has been created, don't recreate it a second time |
| 1578 if (compositor_host_window_) | 1579 if (compositor_host_window_) |
| 1579 return compositor_host_window_; | 1580 return compositor_host_window_; |
| 1580 | 1581 |
| 1581 static ATOM window_class = 0; | 1582 static ATOM window_class = 0; |
| 1582 if (!window_class) { | 1583 if (!window_class) { |
| 1583 WNDCLASSEX wcex; | 1584 WNDCLASSEX wcex; |
| 1584 wcex.cbSize = sizeof(WNDCLASSEX); | 1585 wcex.cbSize = sizeof(WNDCLASSEX); |
| 1585 wcex.style = 0; | 1586 wcex.style = 0; |
| 1586 wcex.lpfnWndProc = CompositorHostWindowProc; | 1587 wcex.lpfnWndProc = |
| 1588 base::win::WrappedWindowProc<CompositorHostWindowProc>; |
| 1587 wcex.cbClsExtra = 0; | 1589 wcex.cbClsExtra = 0; |
| 1588 wcex.cbWndExtra = 0; | 1590 wcex.cbWndExtra = 0; |
| 1589 wcex.hInstance = GetModuleHandle(NULL); | 1591 wcex.hInstance = GetModuleHandle(NULL); |
| 1590 wcex.hIcon = 0; | 1592 wcex.hIcon = 0; |
| 1591 wcex.hCursor = 0; | 1593 wcex.hCursor = 0; |
| 1592 wcex.hbrBackground = NULL; | 1594 wcex.hbrBackground = NULL; |
| 1593 wcex.lpszMenuName = 0; | 1595 wcex.lpszMenuName = 0; |
| 1594 wcex.lpszClassName = L"CompositorHostWindowClass"; | 1596 wcex.lpszClassName = L"CompositorHostWindowClass"; |
| 1595 wcex.hIconSm = 0; | 1597 wcex.hIconSm = 0; |
| 1596 window_class = RegisterClassEx(&wcex); | 1598 window_class = RegisterClassEx(&wcex); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1861 } | 1863 } |
| 1862 | 1864 |
| 1863 // static | 1865 // static |
| 1864 RenderWidgetHostView* | 1866 RenderWidgetHostView* |
| 1865 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1867 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 1866 gfx::NativeView native_view) { | 1868 gfx::NativeView native_view) { |
| 1867 return ::IsWindow(native_view) ? | 1869 return ::IsWindow(native_view) ? |
| 1868 reinterpret_cast<RenderWidgetHostView*>( | 1870 reinterpret_cast<RenderWidgetHostView*>( |
| 1869 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1871 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
| 1870 } | 1872 } |
| OLD | NEW |