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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 int LoadURLWithParams( | 180 int LoadURLWithParams( |
181 const NavigationController::LoadURLParams& load_params) override; | 181 const NavigationController::LoadURLParams& load_params) override; |
182 void SizeContents(const gfx::Size& new_size) override; | 182 void SizeContents(const gfx::Size& new_size) override; |
183 void WillDestroy() override; | 183 void WillDestroy() override; |
184 | 184 |
185 // Exposes the protected web_contents() from WebContentsObserver. | 185 // Exposes the protected web_contents() from WebContentsObserver. |
186 WebContentsImpl* GetWebContents() const; | 186 WebContentsImpl* GetWebContents() const; |
187 | 187 |
188 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; | 188 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; |
189 | 189 |
190 void SetContextMenuPosition(const gfx::Point& position); | |
191 | |
190 // Helper to send messages to embedder. If this guest is not yet attached, | 192 // Helper to send messages to embedder. If this guest is not yet attached, |
191 // then IPCs will be queued until attachment. | 193 // then IPCs will be queued until attachment. |
192 void SendMessageToEmbedder(IPC::Message* msg); | 194 void SendMessageToEmbedder(IPC::Message* msg); |
193 | 195 |
194 // Returns whether the guest is attached to an embedder. | 196 // Returns whether the guest is attached to an embedder. |
195 bool attached() const { return attached_; } | 197 bool attached() const { return attached_; } |
196 | 198 |
197 // Returns true when an attachment has taken place since the last time the | 199 // Returns true when an attachment has taken place since the last time the |
198 // compositor surface was set. | 200 // compositor surface was set. |
199 bool has_attached_since_surface_set() const { | 201 bool has_attached_since_surface_set() const { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
433 // Last seen state of drag status update. | 435 // Last seen state of drag status update. |
434 blink::WebDragStatus last_drag_status_; | 436 blink::WebDragStatus last_drag_status_; |
435 // Whether or not our embedder has seen a SystemDragEnded() call. | 437 // Whether or not our embedder has seen a SystemDragEnded() call. |
436 bool seen_embedder_system_drag_ended_; | 438 bool seen_embedder_system_drag_ended_; |
437 // Whether or not our embedder has seen a DragSourceEndedAt() call. | 439 // Whether or not our embedder has seen a DragSourceEndedAt() call. |
438 bool seen_embedder_drag_source_ended_at_; | 440 bool seen_embedder_drag_source_ended_at_; |
439 | 441 |
440 // Indicates the URL dragged into the guest if any. | 442 // Indicates the URL dragged into the guest if any. |
441 GURL dragged_url_; | 443 GURL dragged_url_; |
442 | 444 |
445 // An offset used to find the position of the context menu | |
446 gfx::Point context_menu_position_; | |
wjmaclean
2015/08/17 13:05:23
Why do we have this? It doesn't seem to be used (o
Ehsaan
2015/08/17 14:09:12
My mistake! I was initially setting this value her
| |
447 | |
443 // Guests generate frames and send a CompositorFrameSwapped (CFS) message | 448 // Guests generate frames and send a CompositorFrameSwapped (CFS) message |
444 // indicating the next frame is ready to be positioned and composited. | 449 // indicating the next frame is ready to be positioned and composited. |
445 // Subsequent frames are not generated until the IPC is ACKed. We would like | 450 // Subsequent frames are not generated until the IPC is ACKed. We would like |
446 // to ensure that the guest generates frames on attachment so we directly ACK | 451 // to ensure that the guest generates frames on attachment so we directly ACK |
447 // an unACKed CFS. ACKs could get lost between the time a guest is detached | 452 // an unACKed CFS. ACKs could get lost between the time a guest is detached |
448 // from a container and the time it is attached elsewhere. This mitigates this | 453 // from a container and the time it is attached elsewhere. This mitigates this |
449 // race by ensuring the guest is ACKed on attachment. | 454 // race by ensuring the guest is ACKed on attachment. |
450 scoped_ptr<FrameMsg_CompositorFrameSwapped_Params> last_pending_frame_; | 455 scoped_ptr<FrameMsg_CompositorFrameSwapped_Params> last_pending_frame_; |
451 | 456 |
452 // This is a queue of messages that are destined to be sent to the embedder | 457 // This is a queue of messages that are destined to be sent to the embedder |
453 // once the guest is attached to a particular embedder. | 458 // once the guest is attached to a particular embedder. |
454 std::deque<linked_ptr<IPC::Message> > pending_messages_; | 459 std::deque<linked_ptr<IPC::Message> > pending_messages_; |
455 | 460 |
456 BrowserPluginGuestDelegate* const delegate_; | 461 BrowserPluginGuestDelegate* const delegate_; |
457 | 462 |
458 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 463 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
459 // permission. | 464 // permission. |
460 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 465 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
461 | 466 |
462 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 467 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
463 }; | 468 }; |
464 | 469 |
465 } // namespace content | 470 } // namespace content |
466 | 471 |
467 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 472 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |