| 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. Any | 9 // BrowserPluginGuest lives on the UI thread of the browser process. Any |
| 10 // messages about the guest render process that the embedder might be interested | 10 // messages about the guest render process that the embedder might be interested |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 struct SurfaceSequence; | 56 struct SurfaceSequence; |
| 57 } // namespace cc | 57 } // namespace cc |
| 58 | 58 |
| 59 namespace gfx { | 59 namespace gfx { |
| 60 class Range; | 60 class Range; |
| 61 } // namespace gfx | 61 } // namespace gfx |
| 62 | 62 |
| 63 namespace content { | 63 namespace content { |
| 64 | 64 |
| 65 class BrowserPluginGuestManager; | 65 class BrowserPluginGuestManager; |
| 66 class RenderFrameHostImpl; |
| 66 class RenderViewHostImpl; | 67 class RenderViewHostImpl; |
| 67 class RenderWidgetHost; | 68 class RenderWidgetHost; |
| 68 class RenderWidgetHostView; | 69 class RenderWidgetHostView; |
| 69 class RenderWidgetHostViewBase; | 70 class RenderWidgetHostViewBase; |
| 70 class SiteInstance; | 71 class SiteInstance; |
| 71 struct DropData; | 72 struct DropData; |
| 72 struct TextInputState; | 73 struct TextInputState; |
| 73 | 74 |
| 74 // A browser plugin guest provides functionality for WebContents to operate in | 75 // A browser plugin guest provides functionality for WebContents to operate in |
| 75 // the guest role and implements guest-specific overrides for ViewHostMsg_* | 76 // the guest role and implements guest-specific overrides for ViewHostMsg_* |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 has_attached_since_surface_set_ = has_attached; | 273 has_attached_since_surface_set_ = has_attached; |
| 273 } | 274 } |
| 274 | 275 |
| 275 void set_attached_for_test(bool attached) { | 276 void set_attached_for_test(bool attached) { |
| 276 attached_ = attached; | 277 attached_ = attached; |
| 277 } | 278 } |
| 278 | 279 |
| 279 private: | 280 private: |
| 280 class EmbedderVisibilityObserver; | 281 class EmbedderVisibilityObserver; |
| 281 | 282 |
| 283 // The RenderFrameHost embedding/containing the BrowserPlugin. |
| 284 RenderFrameHostImpl* GetEmbedderFrame() const; |
| 285 |
| 282 void InitInternal(const BrowserPluginHostMsg_Attach_Params& params, | 286 void InitInternal(const BrowserPluginHostMsg_Attach_Params& params, |
| 283 WebContentsImpl* owner_web_contents); | 287 WebContentsImpl* owner_web_contents); |
| 284 | 288 |
| 285 void OnSatisfySequence(int instance_id, const cc::SurfaceSequence& sequence); | 289 void OnSatisfySequence(int instance_id, const cc::SurfaceSequence& sequence); |
| 286 void OnRequireSequence(int instance_id, | 290 void OnRequireSequence(int instance_id, |
| 287 const cc::SurfaceId& id, | 291 const cc::SurfaceId& id, |
| 288 const cc::SurfaceSequence& sequence); | 292 const cc::SurfaceSequence& sequence); |
| 289 // Message handlers for messages from embedder. | 293 // Message handlers for messages from embedder. |
| 290 void OnDetach(int instance_id); | 294 void OnDetach(int instance_id); |
| 291 // Handles drag events from the embedder. | 295 // Handles drag events from the embedder. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // once the guest is attached to a particular embedder. | 453 // once the guest is attached to a particular embedder. |
| 450 std::deque<linked_ptr<IPC::Message> > pending_messages_; | 454 std::deque<linked_ptr<IPC::Message> > pending_messages_; |
| 451 | 455 |
| 452 BrowserPluginGuestDelegate* const delegate_; | 456 BrowserPluginGuestDelegate* const delegate_; |
| 453 | 457 |
| 454 // Whether or not this BrowserPluginGuest can use cross process frames. This | 458 // Whether or not this BrowserPluginGuest can use cross process frames. This |
| 455 // means when we have --use-cross-process-frames-for-guests on, the | 459 // means when we have --use-cross-process-frames-for-guests on, the |
| 456 // WebContents associated with this BrowserPluginGuest has OOPIF structure. | 460 // WebContents associated with this BrowserPluginGuest has OOPIF structure. |
| 457 bool can_use_cross_process_frames_; | 461 bool can_use_cross_process_frames_; |
| 458 | 462 |
| 463 // Routing and process IDs of the embedder frame. |
| 464 int embedder_process_id_; |
| 465 int embedder_routing_id_; |
| 466 |
| 459 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 467 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
| 460 // permission. | 468 // permission. |
| 461 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 469 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
| 462 | 470 |
| 463 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 471 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 464 }; | 472 }; |
| 465 | 473 |
| 466 } // namespace content | 474 } // namespace content |
| 467 | 475 |
| 468 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 476 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |