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 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 // Creates a HWND within the RenderWidgetHostView that will serve as a host | 2549 // Creates a HWND within the RenderWidgetHostView that will serve as a host |
2549 // for a HWND that the GPU process will create. The host window is used | 2550 // for a HWND that the GPU process will create. The host window is used |
2550 // to Z-position the GPU's window relative to other plugin windows. | 2551 // to Z-position the GPU's window relative to other plugin windows. |
2551 gfx::GLSurfaceHandle RenderWidgetHostViewWin::GetCompositingSurface() { | 2552 gfx::GLSurfaceHandle RenderWidgetHostViewWin::GetCompositingSurface() { |
2552 // If the window has been created, don't recreate it a second time | 2553 // If the window has been created, don't recreate it a second time |
2553 if (compositor_host_window_) | 2554 if (compositor_host_window_) |
2554 return gfx::GLSurfaceHandle(compositor_host_window_, true); | 2555 return gfx::GLSurfaceHandle(compositor_host_window_, true); |
2555 | 2556 |
2556 // On Vista and later we present directly to the view window rather than a | 2557 // On Vista and later we present directly to the view window rather than a |
2557 // child window. | 2558 // child window. |
2558 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { | 2559 if (GpuDataManagerImpl::GetInstance()->IsUsingAcceleratedSurface()) { |
2559 if (!accelerated_surface_.get()) | 2560 if (!accelerated_surface_.get()) |
2560 accelerated_surface_.reset(new AcceleratedSurface(m_hWnd)); | 2561 accelerated_surface_.reset(new AcceleratedSurface(m_hWnd)); |
2561 return gfx::GLSurfaceHandle(m_hWnd, true); | 2562 return gfx::GLSurfaceHandle(m_hWnd, true); |
2562 } | 2563 } |
2563 | 2564 |
2564 // On XP we need a child window that can be resized independently of the | 2565 // On XP we need a child window that can be resized independently of the |
2565 // partent. | 2566 // partent. |
2566 static ATOM atom = 0; | 2567 static ATOM atom = 0; |
2567 static HMODULE instance = NULL; | 2568 static HMODULE instance = NULL; |
2568 if (!atom) { | 2569 if (!atom) { |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3166 // receive a focus change in the context of a pointer down message, it means | 3167 // receive a focus change in the context of a pointer down message, it means |
3167 // that the pointer down message occurred on the edit field and we should | 3168 // that the pointer down message occurred on the edit field and we should |
3168 // display the on screen keyboard | 3169 // display the on screen keyboard |
3169 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 3170 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
3170 DisplayOnScreenKeyboardIfNeeded(); | 3171 DisplayOnScreenKeyboardIfNeeded(); |
3171 received_focus_change_after_pointer_down_ = false; | 3172 received_focus_change_after_pointer_down_ = false; |
3172 pointer_down_context_ = false; | 3173 pointer_down_context_ = false; |
3173 } | 3174 } |
3174 | 3175 |
3175 } // namespace content | 3176 } // namespace content |
OLD | NEW |