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_base.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
9 #include "content/browser/gpu/gpu_data_manager_impl.h" | 9 #include "content/browser/gpu/gpu_data_manager_impl.h" |
10 #include "content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.
h" | 10 #include "content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.
h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/command_line.h" | 22 #include "base/command_line.h" |
23 #include "base/message_loop/message_loop.h" | 23 #include "base/message_loop/message_loop.h" |
24 #include "base/win/wrapped_window_proc.h" | 24 #include "base/win/wrapped_window_proc.h" |
25 #include "content/browser/plugin_process_host.h" | 25 #include "content/browser/plugin_process_host.h" |
26 #include "content/browser/plugin_service_impl.h" | 26 #include "content/browser/plugin_service_impl.h" |
27 #include "content/common/plugin_constants_win.h" | 27 #include "content/common/plugin_constants_win.h" |
28 #include "content/common/webplugin_geometry.h" | 28 #include "content/common/webplugin_geometry.h" |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 #include "content/public/browser/child_process_data.h" | 30 #include "content/public/browser/child_process_data.h" |
31 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
32 #include "ui/base/win/hwnd_util.h" | |
33 #include "ui/gfx/dpi_win.h" | |
34 #include "ui/gfx/gdi_util.h" | 32 #include "ui/gfx/gdi_util.h" |
| 33 #include "ui/gfx/win/dpi.h" |
| 34 #include "ui/gfx/win/hwnd_util.h" |
35 #endif | 35 #endif |
36 | 36 |
37 #if defined(TOOLKIT_GTK) | 37 #if defined(TOOLKIT_GTK) |
38 #include <gdk/gdkx.h> | 38 #include <gdk/gdkx.h> |
39 #include <gtk/gtk.h> | 39 #include <gtk/gtk.h> |
40 | 40 |
41 #include "content/browser/renderer_host/gtk_window_utils.h" | 41 #include "content/browser/renderer_host/gtk_window_utils.h" |
42 #endif | 42 #endif |
43 | 43 |
44 namespace content { | 44 namespace content { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 ::SendMessage(GetParent(window), message, wparam, lparam); | 111 ::SendMessage(GetParent(window), message, wparam, lparam); |
112 return 0; | 112 return 0; |
113 default: | 113 default: |
114 break; | 114 break; |
115 } | 115 } |
116 } | 116 } |
117 return ::DefWindowProc(window, message, wparam, lparam); | 117 return ::DefWindowProc(window, message, wparam, lparam); |
118 } | 118 } |
119 | 119 |
120 bool IsPluginWrapperWindow(HWND window) { | 120 bool IsPluginWrapperWindow(HWND window) { |
121 return ui::GetClassNameW(window) == | 121 return gfx::GetClassNameW(window) == |
122 string16(kWrapperNativeWindowClassName); | 122 string16(kWrapperNativeWindowClassName); |
123 } | 123 } |
124 | 124 |
125 // Create an intermediate window between the given HWND and its parent. | 125 // Create an intermediate window between the given HWND and its parent. |
126 HWND ReparentWindow(HWND window, HWND parent) { | 126 HWND ReparentWindow(HWND window, HWND parent) { |
127 static ATOM atom = 0; | 127 static ATOM atom = 0; |
128 static HMODULE instance = NULL; | 128 static HMODULE instance = NULL; |
129 if (!atom) { | 129 if (!atom) { |
130 WNDCLASSEX window_class; | 130 WNDCLASSEX window_class; |
131 base::win::InitializeWindowClass( | 131 base::win::InitializeWindowClass( |
(...skipping 12 matching lines...) Expand all Loading... |
144 instance = window_class.hInstance; | 144 instance = window_class.hInstance; |
145 atom = RegisterClassEx(&window_class); | 145 atom = RegisterClassEx(&window_class); |
146 } | 146 } |
147 DCHECK(atom); | 147 DCHECK(atom); |
148 | 148 |
149 HWND new_parent = CreateWindowEx( | 149 HWND new_parent = CreateWindowEx( |
150 WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, | 150 WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, |
151 MAKEINTATOM(atom), 0, | 151 MAKEINTATOM(atom), 0, |
152 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, | 152 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, |
153 0, 0, 0, 0, parent, 0, instance, 0); | 153 0, 0, 0, 0, parent, 0, instance, 0); |
154 ui::CheckWindowCreated(new_parent); | 154 gfx::CheckWindowCreated(new_parent); |
155 ::SetParent(window, new_parent); | 155 ::SetParent(window, new_parent); |
156 // How many times we try to find a PluginProcessHost whose process matches | 156 // How many times we try to find a PluginProcessHost whose process matches |
157 // the HWND. | 157 // the HWND. |
158 static const int kMaxTries = 5; | 158 static const int kMaxTries = 5; |
159 BrowserThread::PostTask( | 159 BrowserThread::PostTask( |
160 BrowserThread::IO, | 160 BrowserThread::IO, |
161 FROM_HERE, | 161 FROM_HERE, |
162 base::Bind(&NotifyPluginProcessHostHelper, window, new_parent, | 162 base::Bind(&NotifyPluginProcessHostHelper, window, new_parent, |
163 kMaxTries)); | 163 kMaxTries)); |
164 return new_parent; | 164 return new_parent; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 563 |
564 uint32 RenderWidgetHostViewBase::RendererFrameNumber() { | 564 uint32 RenderWidgetHostViewBase::RendererFrameNumber() { |
565 return renderer_frame_number_; | 565 return renderer_frame_number_; |
566 } | 566 } |
567 | 567 |
568 void RenderWidgetHostViewBase::DidReceiveRendererFrame() { | 568 void RenderWidgetHostViewBase::DidReceiveRendererFrame() { |
569 ++renderer_frame_number_; | 569 ++renderer_frame_number_; |
570 } | 570 } |
571 | 571 |
572 } // namespace content | 572 } // namespace content |
OLD | NEW |