| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| 6 | 6 |
| 7 #include <InputScope.h> | 7 #include <InputScope.h> |
| 8 #include <wtsapi32.h> | 8 #include <wtsapi32.h> |
| 9 #pragma comment(lib, "wtsapi32.lib") | 9 #pragma comment(lib, "wtsapi32.lib") |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 32 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 33 #include "content/browser/gpu/gpu_process_host.h" | 33 #include "content/browser/gpu/gpu_process_host.h" |
| 34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 35 #include "content/browser/renderer_host/backing_store.h" | 35 #include "content/browser/renderer_host/backing_store.h" |
| 36 #include "content/browser/renderer_host/backing_store_win.h" | 36 #include "content/browser/renderer_host/backing_store_win.h" |
| 37 #include "content/browser/renderer_host/render_process_host_impl.h" | 37 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 38 #include "content/browser/renderer_host/render_widget_host_impl.h" | 38 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 39 #include "content/browser/renderer_host/ui_events_helper.h" | 39 #include "content/browser/renderer_host/ui_events_helper.h" |
| 40 #include "content/common/accessibility_messages.h" | 40 #include "content/common/accessibility_messages.h" |
| 41 #include "content/common/gpu/gpu_messages.h" | 41 #include "content/common/gpu/gpu_messages.h" |
| 42 #include "content/common/plugin_constants_win.h" |
| 42 #include "content/common/view_messages.h" | 43 #include "content/common/view_messages.h" |
| 44 #include "content/common/webplugin_geometry.h" |
| 43 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
| 44 #include "content/public/browser/child_process_data.h" | 46 #include "content/public/browser/child_process_data.h" |
| 45 #include "content/public/browser/content_browser_client.h" | 47 #include "content/public/browser/content_browser_client.h" |
| 46 #include "content/public/browser/native_web_keyboard_event.h" | 48 #include "content/public/browser/native_web_keyboard_event.h" |
| 47 #include "content/public/browser/notification_service.h" | 49 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/notification_types.h" | 50 #include "content/public/browser/notification_types.h" |
| 49 #include "content/public/common/content_switches.h" | 51 #include "content/public/common/content_switches.h" |
| 50 #include "content/public/common/page_zoom.h" | 52 #include "content/public/common/page_zoom.h" |
| 51 #include "content/public/common/process_type.h" | 53 #include "content/public/common/process_type.h" |
| 52 #include "skia/ext/skia_utils_win.h" | 54 #include "skia/ext/skia_utils_win.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 65 #include "ui/base/view_prop.h" | 67 #include "ui/base/view_prop.h" |
| 66 #include "ui/base/win/dpi.h" | 68 #include "ui/base/win/dpi.h" |
| 67 #include "ui/base/win/hwnd_util.h" | 69 #include "ui/base/win/hwnd_util.h" |
| 68 #include "ui/base/win/mouse_wheel_util.h" | 70 #include "ui/base/win/mouse_wheel_util.h" |
| 69 #include "ui/base/win/touch_input.h" | 71 #include "ui/base/win/touch_input.h" |
| 70 #include "ui/gfx/canvas.h" | 72 #include "ui/gfx/canvas.h" |
| 71 #include "ui/gfx/rect.h" | 73 #include "ui/gfx/rect.h" |
| 72 #include "ui/gfx/rect_conversions.h" | 74 #include "ui/gfx/rect_conversions.h" |
| 73 #include "ui/gfx/screen.h" | 75 #include "ui/gfx/screen.h" |
| 74 #include "webkit/common/cursors/webcursor.h" | 76 #include "webkit/common/cursors/webcursor.h" |
| 75 #include "webkit/plugins/npapi/plugin_constants_win.h" | |
| 76 #include "webkit/plugins/npapi/webplugin.h" | |
| 77 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | |
| 78 #include "win8/util/win8_util.h" | 77 #include "win8/util/win8_util.h" |
| 79 | 78 |
| 80 using base::TimeDelta; | 79 using base::TimeDelta; |
| 81 using base::TimeTicks; | 80 using base::TimeTicks; |
| 82 using ui::ViewProp; | 81 using ui::ViewProp; |
| 83 using WebKit::WebInputEvent; | 82 using WebKit::WebInputEvent; |
| 84 using WebKit::WebInputEventFactory; | 83 using WebKit::WebInputEventFactory; |
| 85 using WebKit::WebMouseEvent; | 84 using WebKit::WebMouseEvent; |
| 86 using WebKit::WebTextDirection; | 85 using WebKit::WebTextDirection; |
| 87 | 86 |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 SetBrowserAccessibilityManager( | 550 SetBrowserAccessibilityManager( |
| 552 new BrowserAccessibilityManagerWin( | 551 new BrowserAccessibilityManagerWin( |
| 553 m_hWnd, | 552 m_hWnd, |
| 554 window_iaccessible_.get(), | 553 window_iaccessible_.get(), |
| 555 BrowserAccessibilityManagerWin::GetEmptyDocument(), | 554 BrowserAccessibilityManagerWin::GetEmptyDocument(), |
| 556 this)); | 555 this)); |
| 557 } | 556 } |
| 558 | 557 |
| 559 void RenderWidgetHostViewWin::MovePluginWindows( | 558 void RenderWidgetHostViewWin::MovePluginWindows( |
| 560 const gfx::Vector2d& scroll_offset, | 559 const gfx::Vector2d& scroll_offset, |
| 561 const std::vector<webkit::npapi::WebPluginGeometry>& plugin_window_moves) { | 560 const std::vector<WebPluginGeometry>& plugin_window_moves) { |
| 562 MovePluginWindowsHelper(m_hWnd, plugin_window_moves); | 561 MovePluginWindowsHelper(m_hWnd, plugin_window_moves); |
| 563 } | 562 } |
| 564 | 563 |
| 565 static BOOL CALLBACK AddChildWindowToVector(HWND hwnd, LPARAM lparam) { | 564 static BOOL CALLBACK AddChildWindowToVector(HWND hwnd, LPARAM lparam) { |
| 566 std::vector<HWND>* vector = reinterpret_cast<std::vector<HWND>*>(lparam); | 565 std::vector<HWND>* vector = reinterpret_cast<std::vector<HWND>*>(lparam); |
| 567 vector->push_back(hwnd); | 566 vector->push_back(hwnd); |
| 568 return TRUE; | 567 return TRUE; |
| 569 } | 568 } |
| 570 | 569 |
| 571 void RenderWidgetHostViewWin::CleanupCompositorWindow() { | 570 void RenderWidgetHostViewWin::CleanupCompositorWindow() { |
| (...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2313 // an event to the renderer which would then eventually send over | 2312 // an event to the renderer which would then eventually send over |
| 2314 // a setFocus call to the plugin widget. This would ensure that | 2313 // a setFocus call to the plugin widget. This would ensure that |
| 2315 // the renderer (webkit) knows about the plugin widget receiving | 2314 // the renderer (webkit) knows about the plugin widget receiving |
| 2316 // focus. | 2315 // focus. |
| 2317 // TODO(iyengar) Do the right thing as per the above comment. | 2316 // TODO(iyengar) Do the right thing as per the above comment. |
| 2318 POINT cursor_pos = {0}; | 2317 POINT cursor_pos = {0}; |
| 2319 ::GetCursorPos(&cursor_pos); | 2318 ::GetCursorPos(&cursor_pos); |
| 2320 ::ScreenToClient(m_hWnd, &cursor_pos); | 2319 ::ScreenToClient(m_hWnd, &cursor_pos); |
| 2321 HWND child_window = ::RealChildWindowFromPoint(m_hWnd, cursor_pos); | 2320 HWND child_window = ::RealChildWindowFromPoint(m_hWnd, cursor_pos); |
| 2322 if (::IsWindow(child_window) && child_window != m_hWnd) { | 2321 if (::IsWindow(child_window) && child_window != m_hWnd) { |
| 2323 if (ui::GetClassName(child_window) == | 2322 if (ui::GetClassName(child_window) == kWrapperNativeWindowClassName) |
| 2324 webkit::npapi::kWrapperNativeWindowClassName) | |
| 2325 child_window = ::GetWindow(child_window, GW_CHILD); | 2323 child_window = ::GetWindow(child_window, GW_CHILD); |
| 2326 | 2324 |
| 2327 ::SetFocus(child_window); | 2325 ::SetFocus(child_window); |
| 2328 return MA_NOACTIVATE; | 2326 return MA_NOACTIVATE; |
| 2329 } | 2327 } |
| 2330 } | 2328 } |
| 2331 handled = FALSE; | 2329 handled = FALSE; |
| 2332 render_widget_host_->OnPointerEventActivate(); | 2330 render_widget_host_->OnPointerEventActivate(); |
| 2333 return MA_ACTIVATE; | 2331 return MA_ACTIVATE; |
| 2334 } | 2332 } |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3202 return new RenderWidgetHostViewWin(widget); | 3200 return new RenderWidgetHostViewWin(widget); |
| 3203 } | 3201 } |
| 3204 | 3202 |
| 3205 // static | 3203 // static |
| 3206 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3204 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 3207 WebKit::WebScreenInfo* results) { | 3205 WebKit::WebScreenInfo* results) { |
| 3208 GetScreenInfoForWindow(0, results); | 3206 GetScreenInfoForWindow(0, results); |
| 3209 } | 3207 } |
| 3210 | 3208 |
| 3211 } // namespace content | 3209 } // namespace content |
| OLD | NEW |