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 // A BrowserPluginGuest is the browser side of a browser <--> embedder | 5 // A BrowserPluginGuest is the browser side of a browser <--> embedder |
6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder | 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder |
7 // renderer side of browser <--> embedder renderer communication. | 7 // renderer side of browser <--> embedder renderer communication. |
8 // | 8 // |
9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a | 9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a |
10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The | 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 // web contents. | 215 // web contents. |
216 void OnResizeGuest(int instance_id, | 216 void OnResizeGuest(int instance_id, |
217 const BrowserPluginHostMsg_ResizeGuest_Params& params); | 217 const BrowserPluginHostMsg_ResizeGuest_Params& params); |
218 // Updates the size state of the guest. | 218 // Updates the size state of the guest. |
219 void OnSetSize( | 219 void OnSetSize( |
220 int instance_id, | 220 int instance_id, |
221 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 221 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
222 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 222 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
223 // Overriden in tests. | 223 // Overriden in tests. |
224 virtual void OnSetFocus(int instance_id, bool focused); | 224 virtual void OnSetFocus(int instance_id, bool focused); |
225 // Sets the name of the guest so that other guests of the same partition can | |
Charlie Reis
2013/01/04 21:36:33
nit: guests in the same partition
Fady Samuel
2013/01/08 16:19:07
Done.
| |
226 // access it. | |
227 void OnSetName(int instance_id, const std::string& name); | |
225 // The guest WebContents is visible if both its embedder is visible and | 228 // The guest WebContents is visible if both its embedder is visible and |
226 // the browser plugin element is visible. If either one is not then the | 229 // the browser plugin element is visible. If either one is not then the |
227 // WebContents is marked as hidden. A hidden WebContents will consume | 230 // WebContents is marked as hidden. A hidden WebContents will consume |
228 // fewer GPU and CPU resources. | 231 // fewer GPU and CPU resources. |
229 // | 232 // |
230 // When every WebContents in a RenderProcessHost is hidden, it will lower | 233 // When every WebContents in a RenderProcessHost is hidden, it will lower |
231 // the priority of the process (see RenderProcessHostImpl::WidgetHidden). | 234 // the priority of the process (see RenderProcessHostImpl::WidgetHidden). |
232 // | 235 // |
233 // It will also send a message to the guest renderer process to cleanup | 236 // It will also send a message to the guest renderer process to cleanup |
234 // resources such as dropping back buffers and adjusting memory limits (if in | 237 // resources such as dropping back buffers and adjusting memory limits (if in |
(...skipping 21 matching lines...) Expand all Loading... | |
256 void OnSetCursor(const WebCursor& cursor); | 259 void OnSetCursor(const WebCursor& cursor); |
257 // On MacOSX popups are painted by the browser process. We handle them here | 260 // On MacOSX popups are painted by the browser process. We handle them here |
258 // so that they are positioned correctly. | 261 // so that they are positioned correctly. |
259 #if defined(OS_MACOSX) | 262 #if defined(OS_MACOSX) |
260 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 263 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
261 #endif | 264 #endif |
262 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 265 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
263 // Overriden in tests. | 266 // Overriden in tests. |
264 virtual void OnTakeFocus(bool reverse); | 267 virtual void OnTakeFocus(bool reverse); |
265 void OnUpdateDragCursor(WebKit::WebDragOperation operation); | 268 void OnUpdateDragCursor(WebKit::WebDragOperation operation); |
269 void OnUpdateFrameName(int frame_id, | |
270 bool is_top_level, | |
271 const std::string& name); | |
266 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 272 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
267 | 273 |
268 // Static factory instance (always NULL for non-test). | 274 // Static factory instance (always NULL for non-test). |
269 static content::BrowserPluginHostFactory* factory_; | 275 static content::BrowserPluginHostFactory* factory_; |
270 | 276 |
271 NotificationRegistrar notification_registrar_; | 277 NotificationRegistrar notification_registrar_; |
272 WebContentsImpl* embedder_web_contents_; | 278 WebContentsImpl* embedder_web_contents_; |
273 // An identifier that uniquely identifies a browser plugin guest within an | 279 // An identifier that uniquely identifies a browser plugin guest within an |
274 // embedder. | 280 // embedder. |
275 int instance_id_; | 281 int instance_id_; |
276 scoped_ptr<base::SharedMemory> damage_buffer_; | 282 scoped_ptr<base::SharedMemory> damage_buffer_; |
277 // An identifier that uniquely identifies a damage buffer. | 283 // An identifier that uniquely identifies a damage buffer. |
278 uint32 damage_buffer_sequence_id_; | 284 uint32 damage_buffer_sequence_id_; |
279 size_t damage_buffer_size_; | 285 size_t damage_buffer_size_; |
280 gfx::Size damage_view_size_; | 286 gfx::Size damage_view_size_; |
281 float damage_buffer_scale_factor_; | 287 float damage_buffer_scale_factor_; |
282 gfx::Rect guest_window_rect_; | 288 gfx::Rect guest_window_rect_; |
283 gfx::Rect guest_screen_rect_; | 289 gfx::Rect guest_screen_rect_; |
284 base::TimeDelta guest_hang_timeout_; | 290 base::TimeDelta guest_hang_timeout_; |
285 bool focused_; | 291 bool focused_; |
286 bool visible_; | 292 bool visible_; |
293 std::string name_; | |
287 bool auto_size_enabled_; | 294 bool auto_size_enabled_; |
288 gfx::Size max_auto_size_; | 295 gfx::Size max_auto_size_; |
289 gfx::Size min_auto_size_; | 296 gfx::Size min_auto_size_; |
290 | 297 |
291 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 298 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
292 }; | 299 }; |
293 | 300 |
294 } // namespace content | 301 } // namespace content |
295 | 302 |
296 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 303 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |