| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 const BrowserPluginHostMsg_Attach_Params& params); | 191 const BrowserPluginHostMsg_Attach_Params& params); |
| 192 | 192 |
| 193 // Returns whether BrowserPluginGuest is interested in receiving the given | 193 // Returns whether BrowserPluginGuest is interested in receiving the given |
| 194 // |message|. | 194 // |message|. |
| 195 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); | 195 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); |
| 196 | 196 |
| 197 void DragSourceEndedAt(int client_x, int client_y, int screen_x, | 197 void DragSourceEndedAt(int client_x, int client_y, int screen_x, |
| 198 int screen_y, blink::WebDragOperation operation); | 198 int screen_y, blink::WebDragOperation operation); |
| 199 | 199 |
| 200 // Called when the drag started by this guest ends at an OS-level. | 200 // Called when the drag started by this guest ends at an OS-level. |
| 201 void EndSystemDrag(); | 201 void EmbedderSystemDragEnded(); |
| 202 void EndSystemDragIfApplicable(); |
| 202 | 203 |
| 203 void RespondToPermissionRequest(int request_id, | 204 void RespondToPermissionRequest(int request_id, |
| 204 bool should_allow, | 205 bool should_allow, |
| 205 const std::string& user_input); | 206 const std::string& user_input); |
| 206 | 207 |
| 207 void PointerLockPermissionResponse(bool allow); | 208 void PointerLockPermissionResponse(bool allow); |
| 208 | 209 |
| 209 void SwapCompositorFrame(uint32 output_surface_id, | 210 void SwapCompositorFrame(uint32 output_surface_id, |
| 210 int host_process_id, | 211 int host_process_id, |
| 211 int host_routing_id, | 212 int host_routing_id, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 381 |
| 381 // Text input type states. | 382 // Text input type states. |
| 382 ui::TextInputType last_text_input_type_; | 383 ui::TextInputType last_text_input_type_; |
| 383 ui::TextInputMode last_input_mode_; | 384 ui::TextInputMode last_input_mode_; |
| 384 int last_input_flags_; | 385 int last_input_flags_; |
| 385 bool last_can_compose_inline_; | 386 bool last_can_compose_inline_; |
| 386 | 387 |
| 387 // The is the routing ID for a swapped out RenderView for the guest | 388 // The is the routing ID for a swapped out RenderView for the guest |
| 388 // WebContents in the embedder's process. | 389 // WebContents in the embedder's process. |
| 389 int guest_proxy_routing_id_; | 390 int guest_proxy_routing_id_; |
| 391 // Last seen state of drag status update. |
| 392 blink::WebDragStatus last_drag_status_; |
| 393 // Whether or not our embedder has seen a SystemDragEnded() call. |
| 394 bool seen_embedder_system_drag_ended_; |
| 395 // Whether or not our embedder has seen a DragSourceEndedAt() call. |
| 396 bool seen_embedder_drag_source_ended_at_; |
| 390 | 397 |
| 391 // Guests generate frames and send a CompositorFrameSwapped (CFS) message | 398 // Guests generate frames and send a CompositorFrameSwapped (CFS) message |
| 392 // indicating the next frame is ready to be positioned and composited. | 399 // indicating the next frame is ready to be positioned and composited. |
| 393 // Subsequent frames are not generated until the IPC is ACKed. We would like | 400 // Subsequent frames are not generated until the IPC is ACKed. We would like |
| 394 // to ensure that the guest generates frames on attachment so we directly ACK | 401 // to ensure that the guest generates frames on attachment so we directly ACK |
| 395 // an unACKed CFS. ACKs could get lost between the time a guest is detached | 402 // an unACKed CFS. ACKs could get lost between the time a guest is detached |
| 396 // from a container and the time it is attached elsewhere. This mitigates this | 403 // from a container and the time it is attached elsewhere. This mitigates this |
| 397 // race by ensuring the guest is ACKed on attachment. | 404 // race by ensuring the guest is ACKed on attachment. |
| 398 scoped_ptr<FrameMsg_CompositorFrameSwapped_Params> last_pending_frame_; | 405 scoped_ptr<FrameMsg_CompositorFrameSwapped_Params> last_pending_frame_; |
| 399 | 406 |
| 400 // This is a queue of messages that are destined to be sent to the embedder | 407 // This is a queue of messages that are destined to be sent to the embedder |
| 401 // once the guest is attached to a particular embedder. | 408 // once the guest is attached to a particular embedder. |
| 402 std::deque<linked_ptr<IPC::Message> > pending_messages_; | 409 std::deque<linked_ptr<IPC::Message> > pending_messages_; |
| 403 | 410 |
| 404 BrowserPluginGuestDelegate* const delegate_; | 411 BrowserPluginGuestDelegate* const delegate_; |
| 405 | 412 |
| 406 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 413 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
| 407 // permission. | 414 // permission. |
| 408 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 415 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
| 409 | 416 |
| 410 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 417 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 411 }; | 418 }; |
| 412 | 419 |
| 413 } // namespace content | 420 } // namespace content |
| 414 | 421 |
| 415 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 422 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |