| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 7 | 7 |
| 8 #include "third_party/WebKit/public/web/WebPlugin.h" | 8 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 virtual base::SharedMemory* CreateDamageBuffer( | 245 virtual base::SharedMemory* CreateDamageBuffer( |
| 246 const size_t size, | 246 const size_t size, |
| 247 base::SharedMemoryHandle* shared_memory_handle); | 247 base::SharedMemoryHandle* shared_memory_handle); |
| 248 // Swaps out the |current_damage_buffer_| with the |pending_damage_buffer_|. | 248 // Swaps out the |current_damage_buffer_| with the |pending_damage_buffer_|. |
| 249 void SwapDamageBuffers(); | 249 void SwapDamageBuffers(); |
| 250 | 250 |
| 251 // Populates BrowserPluginHostMsg_ResizeGuest_Params with resize state and | 251 // Populates BrowserPluginHostMsg_ResizeGuest_Params with resize state and |
| 252 // allocates a new |pending_damage_buffer_| if in software rendering mode. | 252 // allocates a new |pending_damage_buffer_| if in software rendering mode. |
| 253 void PopulateResizeGuestParameters( | 253 void PopulateResizeGuestParameters( |
| 254 BrowserPluginHostMsg_ResizeGuest_Params* params, | 254 BrowserPluginHostMsg_ResizeGuest_Params* params, |
| 255 const gfx::Rect& view_size); | 255 const gfx::Rect& view_size, |
| 256 bool needs_repaint); |
| 256 | 257 |
| 257 // Populates BrowserPluginHostMsg_AutoSize_Params object with autosize state. | 258 // Populates BrowserPluginHostMsg_AutoSize_Params object with autosize state. |
| 258 void PopulateAutoSizeParameters( | 259 void PopulateAutoSizeParameters( |
| 259 BrowserPluginHostMsg_AutoSize_Params* params, bool current_auto_size); | 260 BrowserPluginHostMsg_AutoSize_Params* params, bool auto_size_enabled); |
| 260 | 261 |
| 261 // Populates both AutoSize and ResizeGuest parameters based on the current | 262 // Populates both AutoSize and ResizeGuest parameters based on the current |
| 262 // autosize state. | 263 // autosize state. |
| 263 void GetDamageBufferWithSizeParams( | 264 void GetDamageBufferWithSizeParams( |
| 264 BrowserPluginHostMsg_AutoSize_Params* auto_size_params, | 265 BrowserPluginHostMsg_AutoSize_Params* auto_size_params, |
| 265 BrowserPluginHostMsg_ResizeGuest_Params* resize_guest_params); | 266 BrowserPluginHostMsg_ResizeGuest_Params* resize_guest_params, |
| 267 bool needs_repaint); |
| 266 | 268 |
| 267 // Informs the guest of an updated autosize state. | 269 // Informs the guest of an updated autosize state. |
| 268 void UpdateGuestAutoSizeState(bool current_auto_size); | 270 void UpdateGuestAutoSizeState(bool auto_size_enabled); |
| 269 | 271 |
| 270 // Indicates whether a damage buffer was used by the guest process for the | 272 // Indicates whether a damage buffer was used by the guest process for the |
| 271 // provided |params|. | 273 // provided |params|. |
| 272 static bool UsesDamageBuffer( | 274 static bool UsesDamageBuffer( |
| 273 const BrowserPluginMsg_UpdateRect_Params& params); | 275 const BrowserPluginMsg_UpdateRect_Params& params); |
| 274 | 276 |
| 275 // Indicates whether the |pending_damage_buffer_| was used to copy over pixels | 277 // Indicates whether the |pending_damage_buffer_| was used to copy over pixels |
| 276 // given the provided |params|. | 278 // given the provided |params|. |
| 277 bool UsesPendingDamageBuffer( | 279 bool UsesPendingDamageBuffer( |
| 278 const BrowserPluginMsg_UpdateRect_Params& params); | 280 const BrowserPluginMsg_UpdateRect_Params& params); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 305 // We cache the |render_view_|'s routing ID because we need it on destruction. | 307 // We cache the |render_view_|'s routing ID because we need it on destruction. |
| 306 // If the |render_view_| is destroyed before the BrowserPlugin is destroyed | 308 // If the |render_view_| is destroyed before the BrowserPlugin is destroyed |
| 307 // then we will attempt to access a NULL pointer. | 309 // then we will attempt to access a NULL pointer. |
| 308 int render_view_routing_id_; | 310 int render_view_routing_id_; |
| 309 WebKit::WebPluginContainer* container_; | 311 WebKit::WebPluginContainer* container_; |
| 310 scoped_ptr<BrowserPluginBindings> bindings_; | 312 scoped_ptr<BrowserPluginBindings> bindings_; |
| 311 scoped_ptr<BrowserPluginBackingStore> backing_store_; | 313 scoped_ptr<BrowserPluginBackingStore> backing_store_; |
| 312 scoped_ptr<base::SharedMemory> current_damage_buffer_; | 314 scoped_ptr<base::SharedMemory> current_damage_buffer_; |
| 313 scoped_ptr<base::SharedMemory> pending_damage_buffer_; | 315 scoped_ptr<base::SharedMemory> pending_damage_buffer_; |
| 314 uint32 damage_buffer_sequence_id_; | 316 uint32 damage_buffer_sequence_id_; |
| 315 bool resize_ack_received_; | 317 bool paint_ack_received_; |
| 316 gfx::Rect plugin_rect_; | 318 gfx::Rect plugin_rect_; |
| 317 float last_device_scale_factor_; | 319 float last_device_scale_factor_; |
| 318 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. | 320 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. |
| 319 SkBitmap* sad_guest_; | 321 SkBitmap* sad_guest_; |
| 320 bool guest_crashed_; | 322 bool guest_crashed_; |
| 321 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> pending_resize_params_; | 323 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> pending_resize_params_; |
| 322 bool auto_size_ack_pending_; | 324 bool is_auto_size_state_dirty_; |
| 325 // Maximum size constraint for autosize. |
| 326 gfx::Size max_auto_size_; |
| 323 std::string storage_partition_id_; | 327 std::string storage_partition_id_; |
| 324 bool persist_storage_; | 328 bool persist_storage_; |
| 325 bool valid_partition_id_; | 329 bool valid_partition_id_; |
| 326 int content_window_routing_id_; | 330 int content_window_routing_id_; |
| 327 bool plugin_focused_; | 331 bool plugin_focused_; |
| 328 // Tracks the visibility of the browser plugin regardless of the whole | 332 // Tracks the visibility of the browser plugin regardless of the whole |
| 329 // embedder RenderView's visibility. | 333 // embedder RenderView's visibility. |
| 330 bool visible_; | 334 bool visible_; |
| 331 | 335 |
| 332 WebCursor cursor_; | 336 WebCursor cursor_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 355 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 359 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
| 356 | 360 |
| 357 std::vector<EditCommand> edit_commands_; | 361 std::vector<EditCommand> edit_commands_; |
| 358 | 362 |
| 359 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 363 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 360 }; | 364 }; |
| 361 | 365 |
| 362 } // namespace content | 366 } // namespace content |
| 363 | 367 |
| 364 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 368 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| OLD | NEW |