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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 bool OnMessageReceived(const IPC::Message& message) override; | 177 bool OnMessageReceived(const IPC::Message& message) override; |
177 bool OnMessageReceived(const IPC::Message& message, | 178 bool OnMessageReceived(const IPC::Message& message, |
178 RenderFrameHost* render_frame_host) override; | 179 RenderFrameHost* render_frame_host) override; |
179 | 180 |
180 // GuestHost implementation. | 181 // GuestHost implementation. |
181 int LoadURLWithParams( | 182 int LoadURLWithParams( |
182 const NavigationController::LoadURLParams& load_params) override; | 183 const NavigationController::LoadURLParams& load_params) override; |
183 void GuestResizeDueToAutoResize(const gfx::Size& new_size) override; | 184 void GuestResizeDueToAutoResize(const gfx::Size& new_size) override; |
184 void SizeContents(const gfx::Size& new_size) override; | 185 void SizeContents(const gfx::Size& new_size) override; |
185 void WillDestroy() override; | 186 void WillDestroy() override; |
| 187 WebContents* RegisterEmbedderID(int process_id, int routing_id) override; |
186 | 188 |
187 // Exposes the protected web_contents() from WebContentsObserver. | 189 // Exposes the protected web_contents() from WebContentsObserver. |
188 WebContentsImpl* GetWebContents() const; | 190 WebContentsImpl* GetWebContents() const; |
189 | 191 |
190 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; | 192 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; |
191 | 193 |
192 // This method is called by the RenderWidgetHostViewGuest to inform the | 194 // This method is called by the RenderWidgetHostViewGuest to inform the |
193 // BrowserPlugin of the potential location of the context menu event (to | 195 // BrowserPlugin of the potential location of the context menu event (to |
194 // come). The need for this (hack) is that the input events when passed on to | 196 // come). The need for this (hack) is that the input events when passed on to |
195 // the BrowserPlugin are modified by any CSS transforms applied on the plugin. | 197 // the BrowserPlugin are modified by any CSS transforms applied on the plugin. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 has_attached_since_surface_set_ = has_attached; | 274 has_attached_since_surface_set_ = has_attached; |
273 } | 275 } |
274 | 276 |
275 void set_attached_for_test(bool attached) { | 277 void set_attached_for_test(bool attached) { |
276 attached_ = attached; | 278 attached_ = attached; |
277 } | 279 } |
278 | 280 |
279 private: | 281 private: |
280 class EmbedderVisibilityObserver; | 282 class EmbedderVisibilityObserver; |
281 | 283 |
| 284 // The RenderFrameHost embedding/containing the BrowserPlugin. |
| 285 RenderFrameHostImpl* GetEmbedderFrame() const; |
| 286 |
282 void InitInternal(const BrowserPluginHostMsg_Attach_Params& params, | 287 void InitInternal(const BrowserPluginHostMsg_Attach_Params& params, |
283 WebContentsImpl* owner_web_contents); | 288 WebContentsImpl* owner_web_contents); |
284 | 289 |
285 void OnSatisfySequence(int instance_id, const cc::SurfaceSequence& sequence); | 290 void OnSatisfySequence(int instance_id, const cc::SurfaceSequence& sequence); |
286 void OnRequireSequence(int instance_id, | 291 void OnRequireSequence(int instance_id, |
287 const cc::SurfaceId& id, | 292 const cc::SurfaceId& id, |
288 const cc::SurfaceSequence& sequence); | 293 const cc::SurfaceSequence& sequence); |
289 // Message handlers for messages from embedder. | 294 // Message handlers for messages from embedder. |
290 void OnDetach(int instance_id); | 295 void OnDetach(int instance_id); |
291 // Handles drag events from the embedder. | 296 // 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. | 454 // once the guest is attached to a particular embedder. |
450 std::deque<linked_ptr<IPC::Message> > pending_messages_; | 455 std::deque<linked_ptr<IPC::Message> > pending_messages_; |
451 | 456 |
452 BrowserPluginGuestDelegate* const delegate_; | 457 BrowserPluginGuestDelegate* const delegate_; |
453 | 458 |
454 // Whether or not this BrowserPluginGuest can use cross process frames. This | 459 // Whether or not this BrowserPluginGuest can use cross process frames. This |
455 // means when we have --use-cross-process-frames-for-guests on, the | 460 // means when we have --use-cross-process-frames-for-guests on, the |
456 // WebContents associated with this BrowserPluginGuest has OOPIF structure. | 461 // WebContents associated with this BrowserPluginGuest has OOPIF structure. |
457 bool can_use_cross_process_frames_; | 462 bool can_use_cross_process_frames_; |
458 | 463 |
| 464 // Routing and process IDs of the embedder frame. |
| 465 int embedder_process_id_; |
| 466 int embedder_routing_id_; |
| 467 |
459 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 468 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
460 // permission. | 469 // permission. |
461 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 470 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
462 | 471 |
463 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 472 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
464 }; | 473 }; |
465 | 474 |
466 } // namespace content | 475 } // namespace content |
467 | 476 |
468 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 477 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |