| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 const gfx::Rect& guest_window_rect, | 212 const gfx::Rect& guest_window_rect, |
| 213 const WebKit::WebInputEvent* event); | 213 const WebKit::WebInputEvent* event); |
| 214 // Reload the guest. Overriden in tests. | 214 // Reload the guest. Overriden in tests. |
| 215 virtual void OnReload(int instance_id); | 215 virtual void OnReload(int instance_id); |
| 216 // Grab the new damage buffer from the embedder, and resize the guest's | 216 // Grab the new damage buffer from the embedder, and resize the guest's |
| 217 // web contents. | 217 // web contents. |
| 218 void OnResizeGuest(int instance_id, | 218 void OnResizeGuest(int instance_id, |
| 219 const BrowserPluginHostMsg_ResizeGuest_Params& params); | 219 const BrowserPluginHostMsg_ResizeGuest_Params& params); |
| 220 // Overriden in tests. | 220 // Overriden in tests. |
| 221 virtual void OnSetFocus(int instance_id, bool focused); | 221 virtual void OnSetFocus(int instance_id, bool focused); |
| 222 // Sets the name of the guest so that other guests in the same partition can |
| 223 // access it. |
| 224 void OnSetName(int instance_id, const std::string& name); |
| 222 // Updates the size state of the guest. | 225 // Updates the size state of the guest. |
| 223 void OnSetSize( | 226 void OnSetSize( |
| 224 int instance_id, | 227 int instance_id, |
| 225 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 228 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 226 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 229 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
| 227 // The guest WebContents is visible if both its embedder is visible and | 230 // The guest WebContents is visible if both its embedder is visible and |
| 228 // the browser plugin element is visible. If either one is not then the | 231 // the browser plugin element is visible. If either one is not then the |
| 229 // WebContents is marked as hidden. A hidden WebContents will consume | 232 // WebContents is marked as hidden. A hidden WebContents will consume |
| 230 // fewer GPU and CPU resources. | 233 // fewer GPU and CPU resources. |
| 231 // | 234 // |
| (...skipping 30 matching lines...) Expand all Loading... |
| 262 void OnSetCursor(const WebCursor& cursor); | 265 void OnSetCursor(const WebCursor& cursor); |
| 263 // On MacOSX popups are painted by the browser process. We handle them here | 266 // On MacOSX popups are painted by the browser process. We handle them here |
| 264 // so that they are positioned correctly. | 267 // so that they are positioned correctly. |
| 265 #if defined(OS_MACOSX) | 268 #if defined(OS_MACOSX) |
| 266 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 269 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
| 267 #endif | 270 #endif |
| 268 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 271 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
| 269 // Overriden in tests. | 272 // Overriden in tests. |
| 270 virtual void OnTakeFocus(bool reverse); | 273 virtual void OnTakeFocus(bool reverse); |
| 271 void OnUpdateDragCursor(WebKit::WebDragOperation operation); | 274 void OnUpdateDragCursor(WebKit::WebDragOperation operation); |
| 275 void OnUpdateFrameName(int frame_id, |
| 276 bool is_top_level, |
| 277 const std::string& name); |
| 272 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 278 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
| 273 | 279 |
| 274 // Static factory instance (always NULL for non-test). | 280 // Static factory instance (always NULL for non-test). |
| 275 static content::BrowserPluginHostFactory* factory_; | 281 static content::BrowserPluginHostFactory* factory_; |
| 276 | 282 |
| 277 NotificationRegistrar notification_registrar_; | 283 NotificationRegistrar notification_registrar_; |
| 278 WebContentsImpl* embedder_web_contents_; | 284 WebContentsImpl* embedder_web_contents_; |
| 279 // An identifier that uniquely identifies a browser plugin guest within an | 285 // An identifier that uniquely identifies a browser plugin guest within an |
| 280 // embedder. | 286 // embedder. |
| 281 int instance_id_; | 287 int instance_id_; |
| 282 scoped_ptr<base::SharedMemory> damage_buffer_; | 288 scoped_ptr<base::SharedMemory> damage_buffer_; |
| 283 // An identifier that uniquely identifies a damage buffer. | 289 // An identifier that uniquely identifies a damage buffer. |
| 284 uint32 damage_buffer_sequence_id_; | 290 uint32 damage_buffer_sequence_id_; |
| 285 size_t damage_buffer_size_; | 291 size_t damage_buffer_size_; |
| 286 gfx::Size damage_view_size_; | 292 gfx::Size damage_view_size_; |
| 287 float damage_buffer_scale_factor_; | 293 float damage_buffer_scale_factor_; |
| 288 gfx::Rect guest_window_rect_; | 294 gfx::Rect guest_window_rect_; |
| 289 gfx::Rect guest_screen_rect_; | 295 gfx::Rect guest_screen_rect_; |
| 290 base::TimeDelta guest_hang_timeout_; | 296 base::TimeDelta guest_hang_timeout_; |
| 291 bool focused_; | 297 bool focused_; |
| 292 bool visible_; | 298 bool visible_; |
| 299 std::string name_; |
| 293 bool auto_size_enabled_; | 300 bool auto_size_enabled_; |
| 294 gfx::Size max_auto_size_; | 301 gfx::Size max_auto_size_; |
| 295 gfx::Size min_auto_size_; | 302 gfx::Size min_auto_size_; |
| 296 | 303 |
| 297 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 304 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 298 }; | 305 }; |
| 299 | 306 |
| 300 } // namespace content | 307 } // namespace content |
| 301 | 308 |
| 302 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 309 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |