OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "app/surface/transport_dib.h" | 11 #include "app/surface/transport_dib.h" |
12 #include "base/atomic_sequence_num.h" | 12 #include "base/atomic_sequence_num.h" |
13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
14 #include "base/process.h" | 14 #include "base/process.h" |
15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
16 #include "base/lock.h" | 16 #include "base/lock.h" |
17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
18 #include "chrome/common/window_container_type.h" | 18 #include "chrome/common/window_container_type.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
20 | 20 |
21 namespace IPC { | 21 namespace IPC { |
22 class Message; | 22 class Message; |
23 } | 23 } |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class TimeDelta; | 26 class TimeDelta; |
27 } | 27 } |
28 | 28 |
29 class ResourceDispatcherHost; | 29 class ResourceDispatcherHost; |
| 30 struct ViewHostMsg_CreateWindow_Params; |
30 struct ViewMsg_ClosePage_Params; | 31 struct ViewMsg_ClosePage_Params; |
31 | 32 |
| 33 |
32 // Instantiated per RenderProcessHost to provide various optimizations on | 34 // Instantiated per RenderProcessHost to provide various optimizations on |
33 // behalf of a RenderWidgetHost. This class bridges between the IO thread | 35 // behalf of a RenderWidgetHost. This class bridges between the IO thread |
34 // where the RenderProcessHost's MessageFilter lives and the UI thread where | 36 // where the RenderProcessHost's MessageFilter lives and the UI thread where |
35 // the RenderWidgetHost lives. | 37 // the RenderWidgetHost lives. |
36 // | 38 // |
37 // | 39 // |
38 // OPTIMIZED RESIZE | 40 // OPTIMIZED RESIZE |
39 // | 41 // |
40 // RenderWidgetHelper is used to implement optimized resize. When the | 42 // RenderWidgetHelper is used to implement optimized resize. When the |
41 // RenderWidgetHost is resized, it sends a Resize message to its RenderWidget | 43 // RenderWidgetHost is resized, it sends a Resize message to its RenderWidget |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Given the id of a transport DIB, return a mapping to it or NULL on error. | 116 // Given the id of a transport DIB, return a mapping to it or NULL on error. |
115 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); | 117 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); |
116 #endif | 118 #endif |
117 | 119 |
118 | 120 |
119 // IO THREAD ONLY ----------------------------------------------------------- | 121 // IO THREAD ONLY ----------------------------------------------------------- |
120 | 122 |
121 // Called on the IO thread when a UpdateRect message is received. | 123 // Called on the IO thread when a UpdateRect message is received. |
122 void DidReceiveUpdateMsg(const IPC::Message& msg); | 124 void DidReceiveUpdateMsg(const IPC::Message& msg); |
123 | 125 |
124 void CreateNewWindow(int opener_id, | 126 void CreateNewWindow(const ViewHostMsg_CreateWindow_Params& params, |
125 bool user_gesture, | |
126 WindowContainerType window_container_type, | |
127 const string16& frame_name, | |
128 base::ProcessHandle render_process, | 127 base::ProcessHandle render_process, |
129 int* route_id); | 128 int* route_id); |
130 void CreateNewWidget(int opener_id, | 129 void CreateNewWidget(int opener_id, |
131 WebKit::WebPopupType popup_type, | 130 WebKit::WebPopupType popup_type, |
132 int* route_id); | 131 int* route_id); |
133 void CreateNewFullscreenWidget(int opener_id, | 132 void CreateNewFullscreenWidget(int opener_id, |
134 WebKit::WebPopupType popup_type, | 133 WebKit::WebPopupType popup_type, |
135 int* route_id); | 134 int* route_id); |
136 | 135 |
137 #if defined(OS_MACOSX) | 136 #if defined(OS_MACOSX) |
(...skipping 22 matching lines...) Expand all Loading... |
160 | 159 |
161 ~RenderWidgetHelper(); | 160 ~RenderWidgetHelper(); |
162 | 161 |
163 // Called on the UI thread to discard a paint message. | 162 // Called on the UI thread to discard a paint message. |
164 void OnDiscardUpdateMsg(UpdateMsgProxy* proxy); | 163 void OnDiscardUpdateMsg(UpdateMsgProxy* proxy); |
165 | 164 |
166 // Called on the UI thread to dispatch a paint message if necessary. | 165 // Called on the UI thread to dispatch a paint message if necessary. |
167 void OnDispatchUpdateMsg(UpdateMsgProxy* proxy); | 166 void OnDispatchUpdateMsg(UpdateMsgProxy* proxy); |
168 | 167 |
169 // Called on the UI thread to finish creating a window. | 168 // Called on the UI thread to finish creating a window. |
170 void OnCreateWindowOnUI(int opener_id, | 169 void OnCreateWindowOnUI(const ViewHostMsg_CreateWindow_Params& params, |
171 int route_id, | 170 int route_id); |
172 WindowContainerType window_container_type, | |
173 string16 frame_name); | |
174 | 171 |
175 // Called on the IO thread after a window was created on the UI thread. | 172 // Called on the IO thread after a window was created on the UI thread. |
176 void OnCreateWindowOnIO(int route_id); | 173 void OnCreateWindowOnIO(int route_id); |
177 | 174 |
178 // Called on the UI thread to finish creating a widget. | 175 // Called on the UI thread to finish creating a widget. |
179 void OnCreateWidgetOnUI(int opener_id, | 176 void OnCreateWidgetOnUI(int opener_id, |
180 int route_id, | 177 int route_id, |
181 WebKit::WebPopupType popup_type); | 178 WebKit::WebPopupType popup_type); |
182 | 179 |
183 // Called on the UI thread to create a full screen widget. | 180 // Called on the UI thread to create a full screen widget. |
(...skipping 30 matching lines...) Expand all Loading... |
214 | 211 |
215 // The next routing id to use. | 212 // The next routing id to use. |
216 base::AtomicSequenceNumber next_routing_id_; | 213 base::AtomicSequenceNumber next_routing_id_; |
217 | 214 |
218 ResourceDispatcherHost* resource_dispatcher_host_; | 215 ResourceDispatcherHost* resource_dispatcher_host_; |
219 | 216 |
220 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 217 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
221 }; | 218 }; |
222 | 219 |
223 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 220 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
OLD | NEW |