| 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 27 matching lines...) Expand all Loading... |
| 38 #include "third_party/WebKit/public/web/WebDragStatus.h" | 38 #include "third_party/WebKit/public/web/WebDragStatus.h" |
| 39 #include "third_party/WebKit/public/web/WebInputEvent.h" | 39 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 40 #include "ui/base/ime/text_input_mode.h" | 40 #include "ui/base/ime/text_input_mode.h" |
| 41 #include "ui/base/ime/text_input_type.h" | 41 #include "ui/base/ime/text_input_type.h" |
| 42 #include "ui/gfx/rect.h" | 42 #include "ui/gfx/rect.h" |
| 43 #include "ui/surface/transport_dib.h" | 43 #include "ui/surface/transport_dib.h" |
| 44 | 44 |
| 45 struct BrowserPluginHostMsg_AutoSize_Params; | 45 struct BrowserPluginHostMsg_AutoSize_Params; |
| 46 struct BrowserPluginHostMsg_Attach_Params; | 46 struct BrowserPluginHostMsg_Attach_Params; |
| 47 struct BrowserPluginHostMsg_ResizeGuest_Params; | 47 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 48 struct FrameHostMsg_BuffersSwappedACK_Params; |
| 49 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
| 48 struct ViewHostMsg_CreateWindow_Params; | 50 struct ViewHostMsg_CreateWindow_Params; |
| 49 #if defined(OS_MACOSX) | 51 #if defined(OS_MACOSX) |
| 50 struct ViewHostMsg_ShowPopup_Params; | 52 struct ViewHostMsg_ShowPopup_Params; |
| 51 #endif | 53 #endif |
| 52 struct ViewHostMsg_UpdateRect_Params; | 54 struct ViewHostMsg_UpdateRect_Params; |
| 53 class WebCursor; | 55 class WebCursor; |
| 54 | 56 |
| 55 namespace cc { | 57 namespace cc { |
| 56 class CompositorFrameAck; | 58 class CompositorFrameAck; |
| 57 } | 59 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 377 |
| 376 bool InAutoSizeBounds(const gfx::Size& size) const; | 378 bool InAutoSizeBounds(const gfx::Size& size) const; |
| 377 | 379 |
| 378 void RequestNewWindowPermission(WindowOpenDisposition disposition, | 380 void RequestNewWindowPermission(WindowOpenDisposition disposition, |
| 379 const gfx::Rect& initial_bounds, | 381 const gfx::Rect& initial_bounds, |
| 380 bool user_gesture, | 382 bool user_gesture, |
| 381 WebContentsImpl* new_contents); | 383 WebContentsImpl* new_contents); |
| 382 | 384 |
| 383 // Message handlers for messages from embedder. | 385 // Message handlers for messages from embedder. |
| 384 | 386 |
| 385 void OnCompositorFrameACK(int instance_id, | 387 void OnCompositorFrameSwappedACK( |
| 386 int route_id, | 388 int instance_id, |
| 387 uint32 output_surface_id, | 389 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); |
| 388 int renderer_host_id, | |
| 389 const cc::CompositorFrameAck& ack); | |
| 390 void OnCopyFromCompositingSurfaceAck(int instance_id, | 390 void OnCopyFromCompositingSurfaceAck(int instance_id, |
| 391 int request_id, | 391 int request_id, |
| 392 const SkBitmap& bitmap); | 392 const SkBitmap& bitmap); |
| 393 // Handles drag events from the embedder. | 393 // Handles drag events from the embedder. |
| 394 // When dragging, the drag events go to the embedder first, and if the drag | 394 // When dragging, the drag events go to the embedder first, and if the drag |
| 395 // happens on the browser plugin, then the plugin sends a corresponding | 395 // happens on the browser plugin, then the plugin sends a corresponding |
| 396 // drag-message to the guest. This routes the drag-message to the guest | 396 // drag-message to the guest. This routes the drag-message to the guest |
| 397 // renderer. | 397 // renderer. |
| 398 void OnDragStatusUpdate(int instance_id, | 398 void OnDragStatusUpdate(int instance_id, |
| 399 blink::WebDragStatus drag_status, | 399 blink::WebDragStatus drag_status, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // It will also send a message to the guest renderer process to cleanup | 450 // It will also send a message to the guest renderer process to cleanup |
| 451 // resources such as dropping back buffers and adjusting memory limits (if in | 451 // resources such as dropping back buffers and adjusting memory limits (if in |
| 452 // compositing mode, see CCLayerTreeHost::setVisible). | 452 // compositing mode, see CCLayerTreeHost::setVisible). |
| 453 // | 453 // |
| 454 // Additionally, it will slow down Javascript execution and garbage | 454 // Additionally, it will slow down Javascript execution and garbage |
| 455 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and | 455 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and |
| 456 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). | 456 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). |
| 457 void OnSetVisibility(int instance_id, bool visible); | 457 void OnSetVisibility(int instance_id, bool visible); |
| 458 // Message from embedder acknowledging last HW buffer. | 458 // Message from embedder acknowledging last HW buffer. |
| 459 void OnSwapBuffersACK(int instance_id, | 459 void OnSwapBuffersACK(int instance_id, |
| 460 int route_id, | 460 const FrameHostMsg_BuffersSwappedACK_Params& params); |
| 461 int gpu_host_id, | |
| 462 const std::string& mailbox_name, | |
| 463 uint32 sync_point); | |
| 464 void OnUnlockMouse(); | 461 void OnUnlockMouse(); |
| 465 void OnUnlockMouseAck(int instance_id); | 462 void OnUnlockMouseAck(int instance_id); |
| 466 void OnUpdateGeometry(int instance_id, const gfx::Rect& view_rect); | 463 void OnUpdateGeometry(int instance_id, const gfx::Rect& view_rect); |
| 467 void OnUpdateRectACK( | 464 void OnUpdateRectACK( |
| 468 int instance_id, | 465 int instance_id, |
| 469 bool needs_ack, | 466 bool needs_ack, |
| 470 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 467 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 471 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 468 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
| 472 | 469 |
| 473 void OnTextInputTypeChanged(ui::TextInputType type, | 470 void OnTextInputTypeChanged(ui::TextInputType type, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 // These are parameters passed from JavaScript on attachment to the content | 599 // These are parameters passed from JavaScript on attachment to the content |
| 603 // embedder. | 600 // embedder. |
| 604 scoped_ptr<base::DictionaryValue> extra_attach_params_; | 601 scoped_ptr<base::DictionaryValue> extra_attach_params_; |
| 605 | 602 |
| 606 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 603 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 607 }; | 604 }; |
| 608 | 605 |
| 609 } // namespace content | 606 } // namespace content |
| 610 | 607 |
| 611 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 608 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |