| 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. It has a | 9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a |
| 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The | 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // BrowserPluginGuest is already destroyed. | 249 // BrowserPluginGuest is already destroyed. |
| 250 static void AcknowledgeBufferPresent(int route_id, | 250 static void AcknowledgeBufferPresent(int route_id, |
| 251 int gpu_host_id, | 251 int gpu_host_id, |
| 252 const std::string& mailbox_name, | 252 const std::string& mailbox_name, |
| 253 uint32 sync_point); | 253 uint32 sync_point); |
| 254 | 254 |
| 255 // Returns whether BrowserPluginGuest is interested in receiving the given | 255 // Returns whether BrowserPluginGuest is interested in receiving the given |
| 256 // |message|. | 256 // |message|. |
| 257 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); | 257 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); |
| 258 | 258 |
| 259 void DragSourceEndedAt(int client_x, int client_y, int screen_x, |
| 260 int screen_y, WebKit::WebDragOperation operation); |
| 261 |
| 262 void DragSourceMovedTo(int client_x, int client_y, |
| 263 int screen_x, int screen_y); |
| 264 |
| 265 // Called when the drag started by this guest ends at an OS-level. |
| 266 void EndSystemDrag(); |
| 267 |
| 259 private: | 268 private: |
| 260 typedef std::pair<MediaStreamRequest, MediaResponseCallback> | 269 typedef std::pair<MediaStreamRequest, MediaResponseCallback> |
| 261 MediaStreamRequestAndCallbackPair; | 270 MediaStreamRequestAndCallbackPair; |
| 262 typedef std::map<int, MediaStreamRequestAndCallbackPair> | 271 typedef std::map<int, MediaStreamRequestAndCallbackPair> |
| 263 MediaStreamRequestsMap; | 272 MediaStreamRequestsMap; |
| 264 | 273 |
| 265 class EmbedderRenderViewHostObserver; | 274 class EmbedderRenderViewHostObserver; |
| 266 friend class TestBrowserPluginGuest; | 275 friend class TestBrowserPluginGuest; |
| 267 | 276 |
| 268 BrowserPluginGuest(int instance_id, | 277 BrowserPluginGuest(int instance_id, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 void OnUnlockMouse(); | 388 void OnUnlockMouse(); |
| 380 void OnUnlockMouseAck(int instance_id); | 389 void OnUnlockMouseAck(int instance_id); |
| 381 void OnUpdateRectACK( | 390 void OnUpdateRectACK( |
| 382 int instance_id, | 391 int instance_id, |
| 383 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 392 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 384 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 393 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
| 385 | 394 |
| 386 | 395 |
| 387 // Message handlers for messages from guest. | 396 // Message handlers for messages from guest. |
| 388 | 397 |
| 398 void OnDragStopped(); |
| 389 void OnHandleInputEventAck( | 399 void OnHandleInputEventAck( |
| 390 WebKit::WebInputEvent::Type event_type, | 400 WebKit::WebInputEvent::Type event_type, |
| 391 InputEventAckState ack_result); | 401 InputEventAckState ack_result); |
| 392 void OnHasTouchEventHandlers(bool accept); | 402 void OnHasTouchEventHandlers(bool accept); |
| 393 void OnSetCursor(const WebCursor& cursor); | 403 void OnSetCursor(const WebCursor& cursor); |
| 394 // On MacOSX popups are painted by the browser process. We handle them here | 404 // On MacOSX popups are painted by the browser process. We handle them here |
| 395 // so that they are positioned correctly. | 405 // so that they are positioned correctly. |
| 396 #if defined(OS_MACOSX) | 406 #if defined(OS_MACOSX) |
| 397 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 407 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
| 398 #endif | 408 #endif |
| 399 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 409 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
| 400 // Overriden in tests. | 410 // Overriden in tests. |
| 401 virtual void OnTakeFocus(bool reverse); | 411 virtual void OnTakeFocus(bool reverse); |
| 402 void OnUpdateDragCursor(WebKit::WebDragOperation operation); | |
| 403 void OnUpdateFrameName(int frame_id, | 412 void OnUpdateFrameName(int frame_id, |
| 404 bool is_top_level, | 413 bool is_top_level, |
| 405 const std::string& name); | 414 const std::string& name); |
| 406 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 415 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
| 407 | 416 |
| 408 // Helpers for |OnRespondPermission|. | 417 // Helpers for |OnRespondPermission|. |
| 409 void OnRespondPermissionDownload(int request_id, bool should_allow); | 418 void OnRespondPermissionDownload(int request_id, bool should_allow); |
| 410 void OnRespondPermissionGeolocation(int request_id, bool should_allow); | 419 void OnRespondPermissionGeolocation(int request_id, bool should_allow); |
| 411 void OnRespondPermissionMedia(int request_id, bool should_allow); | 420 void OnRespondPermissionMedia(int request_id, bool should_allow); |
| 412 void OnRespondPermissionNewWindow(int request_id, bool should_allow); | 421 void OnRespondPermissionNewWindow(int request_id, bool should_allow); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 // This is used to determine whether or not to create a new RenderView when | 499 // This is used to determine whether or not to create a new RenderView when |
| 491 // this guest is attached. | 500 // this guest is attached. |
| 492 bool has_render_view_; | 501 bool has_render_view_; |
| 493 | 502 |
| 494 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 503 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 495 }; | 504 }; |
| 496 | 505 |
| 497 } // namespace content | 506 } // namespace content |
| 498 | 507 |
| 499 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 508 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |