| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <peninputpanel_i.c> | 9 #include <peninputpanel_i.c> |
| 10 #include <stack> | 10 #include <stack> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 16 #include "base/i18n/rtl.h" | 16 #include "base/i18n/rtl.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
| 20 #include "base/win/metro.h" | 20 #include "base/win/metro.h" |
| 21 #include "base/win/scoped_comptr.h" | 21 #include "base/win/scoped_comptr.h" |
| 22 #include "base/win/scoped_gdi_object.h" | 22 #include "base/win/scoped_gdi_object.h" |
| 23 #include "base/win/win_util.h" | 23 #include "base/win/win_util.h" |
| 24 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
| 25 #include "base/win/wrapped_window_proc.h" | 25 #include "base/win/wrapped_window_proc.h" |
| 26 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 26 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 27 #include "content/browser/accessibility/browser_accessibility_win.h" | 27 #include "content/browser/accessibility/browser_accessibility_win.h" |
| 28 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 28 #include "content/browser/gpu/gpu_process_host.h" | 29 #include "content/browser/gpu/gpu_process_host.h" |
| 29 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 30 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 30 #include "content/browser/plugin_process_host.h" | 31 #include "content/browser/plugin_process_host.h" |
| 31 #include "content/browser/renderer_host/backing_store.h" | 32 #include "content/browser/renderer_host/backing_store.h" |
| 32 #include "content/browser/renderer_host/backing_store_win.h" | 33 #include "content/browser/renderer_host/backing_store_win.h" |
| 33 #include "content/browser/renderer_host/render_process_host_impl.h" | 34 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 34 #include "content/browser/renderer_host/render_widget_host_impl.h" | 35 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 35 #include "content/common/accessibility_messages.h" | 36 #include "content/common/accessibility_messages.h" |
| 36 #include "content/common/gpu/gpu_messages.h" | 37 #include "content/common/gpu/gpu_messages.h" |
| 37 #include "content/common/plugin_messages.h" | 38 #include "content/common/plugin_messages.h" |
| (...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2539 // Creates a HWND within the RenderWidgetHostView that will serve as a host | 2540 // Creates a HWND within the RenderWidgetHostView that will serve as a host |
| 2540 // for a HWND that the GPU process will create. The host window is used | 2541 // for a HWND that the GPU process will create. The host window is used |
| 2541 // to Z-position the GPU's window relative to other plugin windows. | 2542 // to Z-position the GPU's window relative to other plugin windows. |
| 2542 gfx::GLSurfaceHandle RenderWidgetHostViewWin::GetCompositingSurface() { | 2543 gfx::GLSurfaceHandle RenderWidgetHostViewWin::GetCompositingSurface() { |
| 2543 // If the window has been created, don't recreate it a second time | 2544 // If the window has been created, don't recreate it a second time |
| 2544 if (compositor_host_window_) | 2545 if (compositor_host_window_) |
| 2545 return gfx::GLSurfaceHandle(compositor_host_window_, true); | 2546 return gfx::GLSurfaceHandle(compositor_host_window_, true); |
| 2546 | 2547 |
| 2547 // On Vista and later we present directly to the view window rather than a | 2548 // On Vista and later we present directly to the view window rather than a |
| 2548 // child window. | 2549 // child window. |
| 2549 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { | 2550 if (GpuDataManagerImpl::GetInstance()->IsUsingAcceleratedSurface()) { |
| 2550 if (!accelerated_surface_.get()) | 2551 if (!accelerated_surface_.get()) |
| 2551 accelerated_surface_.reset(new AcceleratedSurface(m_hWnd)); | 2552 accelerated_surface_.reset(new AcceleratedSurface(m_hWnd)); |
| 2552 return gfx::GLSurfaceHandle(m_hWnd, true); | 2553 return gfx::GLSurfaceHandle(m_hWnd, true); |
| 2553 } | 2554 } |
| 2554 | 2555 |
| 2555 // On XP we need a child window that can be resized independently of the | 2556 // On XP we need a child window that can be resized independently of the |
| 2556 // partent. | 2557 // partent. |
| 2557 static ATOM atom = 0; | 2558 static ATOM atom = 0; |
| 2558 static HMODULE instance = NULL; | 2559 static HMODULE instance = NULL; |
| 2559 if (!atom) { | 2560 if (!atom) { |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3158 // receive a focus change in the context of a pointer down message, it means | 3159 // receive a focus change in the context of a pointer down message, it means |
| 3159 // that the pointer down message occurred on the edit field and we should | 3160 // that the pointer down message occurred on the edit field and we should |
| 3160 // display the on screen keyboard | 3161 // display the on screen keyboard |
| 3161 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 3162 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
| 3162 DisplayOnScreenKeyboardIfNeeded(); | 3163 DisplayOnScreenKeyboardIfNeeded(); |
| 3163 received_focus_change_after_pointer_down_ = false; | 3164 received_focus_change_after_pointer_down_ = false; |
| 3164 pointer_down_context_ = false; | 3165 pointer_down_context_ = false; |
| 3165 } | 3166 } |
| 3166 | 3167 |
| 3167 } // namespace content | 3168 } // namespace content |
| OLD | NEW |