| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 struct FrameHostMsg_CompositorFrameSwappedACK_Params; | 44 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
| 45 struct FrameHostMsg_ReclaimCompositorResources_Params; | 45 struct FrameHostMsg_ReclaimCompositorResources_Params; |
| 46 struct FrameMsg_CompositorFrameSwapped_Params; | 46 struct FrameMsg_CompositorFrameSwapped_Params; |
| 47 | 47 |
| 48 #if defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
| 49 struct FrameHostMsg_ShowPopup_Params; | 49 struct FrameHostMsg_ShowPopup_Params; |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 namespace cc { | 52 namespace cc { |
| 53 class CompositorFrame; | 53 class CompositorFrame; |
| 54 struct SurfaceId; |
| 55 struct SurfaceSequence; |
| 54 } // namespace cc | 56 } // namespace cc |
| 55 | 57 |
| 56 namespace gfx { | 58 namespace gfx { |
| 57 class Range; | 59 class Range; |
| 58 } // namespace gfx | 60 } // namespace gfx |
| 59 | 61 |
| 60 namespace content { | 62 namespace content { |
| 61 | 63 |
| 62 class BrowserPluginGuestManager; | 64 class BrowserPluginGuestManager; |
| 63 class RenderViewHostImpl; | 65 class RenderViewHostImpl; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // Called when the drag started by this guest ends at an OS-level. | 208 // Called when the drag started by this guest ends at an OS-level. |
| 207 void EmbedderSystemDragEnded(); | 209 void EmbedderSystemDragEnded(); |
| 208 void EndSystemDragIfApplicable(); | 210 void EndSystemDragIfApplicable(); |
| 209 | 211 |
| 210 void RespondToPermissionRequest(int request_id, | 212 void RespondToPermissionRequest(int request_id, |
| 211 bool should_allow, | 213 bool should_allow, |
| 212 const std::string& user_input); | 214 const std::string& user_input); |
| 213 | 215 |
| 214 void PointerLockPermissionResponse(bool allow); | 216 void PointerLockPermissionResponse(bool allow); |
| 215 | 217 |
| 218 void UpdateGuestSizeIfNecessary(const gfx::Size& frame_size, |
| 219 float scale_factor); |
| 216 void SwapCompositorFrame(uint32 output_surface_id, | 220 void SwapCompositorFrame(uint32 output_surface_id, |
| 217 int host_process_id, | 221 int host_process_id, |
| 218 int host_routing_id, | 222 int host_routing_id, |
| 219 scoped_ptr<cc::CompositorFrame> frame); | 223 scoped_ptr<cc::CompositorFrame> frame); |
| 224 void SetChildFrameSurface(const cc::SurfaceId& surface_id, |
| 225 const gfx::Size& frame_size, |
| 226 float scale_factor, |
| 227 const cc::SurfaceSequence& sequence); |
| 220 | 228 |
| 221 void SetContentsOpaque(bool opaque); | 229 void SetContentsOpaque(bool opaque); |
| 222 | 230 |
| 223 // Find the given |search_text| in the page. Returns true if the find request | 231 // Find the given |search_text| in the page. Returns true if the find request |
| 224 // is handled by this browser plugin guest. | 232 // is handled by this browser plugin guest. |
| 225 bool Find(int request_id, | 233 bool Find(int request_id, |
| 226 const base::string16& search_text, | 234 const base::string16& search_text, |
| 227 const blink::WebFindOptions& options); | 235 const blink::WebFindOptions& options); |
| 228 bool StopFinding(StopFindAction action); | 236 bool StopFinding(StopFindAction action); |
| 229 | 237 |
| 230 private: | 238 private: |
| 231 class EmbedderVisibilityObserver; | 239 class EmbedderVisibilityObserver; |
| 232 | 240 |
| 233 // BrowserPluginGuest is a WebContentsObserver of |web_contents| and | 241 // BrowserPluginGuest is a WebContentsObserver of |web_contents| and |
| 234 // |web_contents| has to stay valid for the lifetime of BrowserPluginGuest. | 242 // |web_contents| has to stay valid for the lifetime of BrowserPluginGuest. |
| 235 BrowserPluginGuest(bool has_render_view, | 243 BrowserPluginGuest(bool has_render_view, |
| 236 WebContentsImpl* web_contents, | 244 WebContentsImpl* web_contents, |
| 237 BrowserPluginGuestDelegate* delegate); | 245 BrowserPluginGuestDelegate* delegate); |
| 238 | 246 |
| 239 void InitInternal(const BrowserPluginHostMsg_Attach_Params& params, | 247 void InitInternal(const BrowserPluginHostMsg_Attach_Params& params, |
| 240 WebContentsImpl* owner_web_contents); | 248 WebContentsImpl* owner_web_contents); |
| 241 | 249 |
| 242 bool InAutoSizeBounds(const gfx::Size& size) const; | 250 bool InAutoSizeBounds(const gfx::Size& size) const; |
| 243 | 251 |
| 252 void OnSatisfySequence(int instance_id, const cc::SurfaceSequence& sequence); |
| 253 void OnRequireSequence(int instance_id, |
| 254 const cc::SurfaceId& id, |
| 255 const cc::SurfaceSequence& sequence); |
| 244 // Message handlers for messages from embedder. | 256 // Message handlers for messages from embedder. |
| 245 void OnCompositorFrameSwappedACK( | 257 void OnCompositorFrameSwappedACK( |
| 246 int instance_id, | 258 int instance_id, |
| 247 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); | 259 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); |
| 248 void OnDetach(int instance_id); | 260 void OnDetach(int instance_id); |
| 249 // Handles drag events from the embedder. | 261 // Handles drag events from the embedder. |
| 250 // When dragging, the drag events go to the embedder first, and if the drag | 262 // When dragging, the drag events go to the embedder first, and if the drag |
| 251 // happens on the browser plugin, then the plugin sends a corresponding | 263 // happens on the browser plugin, then the plugin sends a corresponding |
| 252 // drag-message to the guest. This routes the drag-message to the guest | 264 // drag-message to the guest. This routes the drag-message to the guest |
| 253 // renderer. | 265 // renderer. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 433 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
| 422 // permission. | 434 // permission. |
| 423 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 435 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
| 424 | 436 |
| 425 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 437 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 426 }; | 438 }; |
| 427 | 439 |
| 428 } // namespace content | 440 } // namespace content |
| 429 | 441 |
| 430 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 442 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |