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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 void OnUpdatedName(int instance_id, const std::string& name); | 278 void OnUpdatedName(int instance_id, const std::string& name); |
279 void OnUpdateRect(int instance_id, | 279 void OnUpdateRect(int instance_id, |
280 const BrowserPluginMsg_UpdateRect_Params& params); | 280 const BrowserPluginMsg_UpdateRect_Params& params); |
281 | 281 |
282 // This is the browser-process-allocated instance ID that uniquely identifies | 282 // This is the browser-process-allocated instance ID that uniquely identifies |
283 // a guest WebContents. | 283 // a guest WebContents. |
284 int guest_instance_id_; | 284 int guest_instance_id_; |
285 // This indicates whether this BrowserPlugin has been attached to a | 285 // This indicates whether this BrowserPlugin has been attached to a |
286 // WebContents. | 286 // WebContents. |
287 bool attached_; | 287 bool attached_; |
288 base::WeakPtr<RenderViewImpl> render_view_; | 288 const base::WeakPtr<RenderViewImpl> render_view_; |
289 // We cache the |render_view_|'s routing ID because we need it on destruction. | 289 // We cache the |render_view_|'s routing ID because we need it on destruction. |
290 // If the |render_view_| is destroyed before the BrowserPlugin is destroyed | 290 // If the |render_view_| is destroyed before the BrowserPlugin is destroyed |
291 // then we will attempt to access a NULL pointer. | 291 // then we will attempt to access a NULL pointer. |
292 int render_view_routing_id_; | 292 const int render_view_routing_id_; |
293 blink::WebPluginContainer* container_; | 293 blink::WebPluginContainer* container_; |
294 scoped_ptr<BrowserPluginBindings> bindings_; | 294 scoped_ptr<BrowserPluginBindings> bindings_; |
295 bool paint_ack_received_; | 295 bool paint_ack_received_; |
296 gfx::Rect plugin_rect_; | 296 gfx::Rect plugin_rect_; |
297 float last_device_scale_factor_; | 297 float last_device_scale_factor_; |
298 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. | 298 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. |
299 SkBitmap* sad_guest_; | 299 SkBitmap* sad_guest_; |
300 bool guest_crashed_; | 300 bool guest_crashed_; |
301 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> pending_resize_params_; | 301 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> pending_resize_params_; |
302 bool is_auto_size_state_dirty_; | 302 bool is_auto_size_state_dirty_; |
303 // Maximum size constraint for autosize. | 303 // Maximum size constraint for autosize. |
304 gfx::Size max_auto_size_; | 304 gfx::Size max_auto_size_; |
305 std::string storage_partition_id_; | 305 std::string storage_partition_id_; |
306 bool persist_storage_; | 306 bool persist_storage_; |
307 bool valid_partition_id_; | 307 bool valid_partition_id_; |
308 int content_window_routing_id_; | 308 int content_window_routing_id_; |
309 bool plugin_focused_; | 309 bool plugin_focused_; |
310 // Tracks the visibility of the browser plugin regardless of the whole | 310 // Tracks the visibility of the browser plugin regardless of the whole |
311 // embedder RenderView's visibility. | 311 // embedder RenderView's visibility. |
312 bool visible_; | 312 bool visible_; |
313 | 313 |
314 bool auto_navigate_; | 314 const bool auto_navigate_; |
315 std::string html_string_; | 315 std::string html_string_; |
316 | 316 |
317 WebCursor cursor_; | 317 WebCursor cursor_; |
318 | 318 |
319 gfx::Size last_view_size_; | 319 gfx::Size last_view_size_; |
320 bool before_first_navigation_; | 320 bool before_first_navigation_; |
321 bool mouse_locked_; | 321 bool mouse_locked_; |
322 | 322 |
323 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to | 323 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to |
324 // store the BrowserPlugin's BrowserPluginManager in a member variable to | 324 // store the BrowserPlugin's BrowserPluginManager in a member variable to |
325 // avoid accessing the RenderViewImpl. | 325 // avoid accessing the RenderViewImpl. |
326 scoped_refptr<BrowserPluginManager> browser_plugin_manager_; | 326 const scoped_refptr<BrowserPluginManager> browser_plugin_manager_; |
327 | 327 |
328 // Used for HW compositing. | 328 // Used for HW compositing. |
329 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; | 329 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
330 | 330 |
331 // Used to identify the plugin to WebBindings. | 331 // Used to identify the plugin to WebBindings. |
332 scoped_ptr<struct _NPP> npp_; | 332 scoped_ptr<struct _NPP> npp_; |
333 | 333 |
334 // URL for the embedder frame. | 334 // URL for the embedder frame. |
335 GURL embedder_frame_url_; | 335 const GURL embedder_frame_url_; |
336 | 336 |
337 std::vector<EditCommand> edit_commands_; | 337 std::vector<EditCommand> edit_commands_; |
338 | 338 |
339 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 339 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
340 // get called after BrowserPlugin has been destroyed. | 340 // get called after BrowserPlugin has been destroyed. |
341 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 341 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
342 | 342 |
343 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 343 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
344 }; | 344 }; |
345 | 345 |
346 } // namespace content | 346 } // namespace content |
347 | 347 |
348 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 348 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |