| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 class SkBitmap; | 40 class SkBitmap; |
| 41 struct BrowserPluginHostMsg_Attach_Params; | 41 struct BrowserPluginHostMsg_Attach_Params; |
| 42 struct BrowserPluginHostMsg_ResizeGuest_Params; | 42 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 43 struct FrameHostMsg_CompositorFrameSwappedACK_Params; | 43 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
| 44 struct FrameHostMsg_ReclaimCompositorResources_Params; | 44 struct FrameHostMsg_ReclaimCompositorResources_Params; |
| 45 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
| 46 struct FrameHostMsg_ShowPopup_Params; | 46 struct FrameHostMsg_ShowPopup_Params; |
| 47 #endif | 47 #endif |
| 48 struct ViewHostMsg_TextInputState_Params; | 48 struct ViewHostMsg_TextInputState_Params; |
| 49 struct ViewHostMsg_UpdateRect_Params; | |
| 50 | 49 |
| 51 namespace blink { | 50 namespace blink { |
| 52 class WebInputEvent; | 51 class WebInputEvent; |
| 53 } // namespace blink | 52 } // namespace blink |
| 54 | 53 |
| 55 namespace cc { | 54 namespace cc { |
| 56 class CompositorFrame; | 55 class CompositorFrame; |
| 57 } // namespace cc | 56 } // namespace cc |
| 58 | 57 |
| 59 namespace gfx { | 58 namespace gfx { |
| 60 class Range; | 59 class Range; |
| 61 } // namespace gfx | 60 } // namespace gfx |
| 62 | 61 |
| 63 namespace content { | 62 namespace content { |
| 64 | 63 |
| 65 class BrowserPluginGuestManager; | 64 class BrowserPluginGuestManager; |
| 66 class RenderViewHostImpl; | 65 class RenderViewHostImpl; |
| 66 class RenderWidgetHost; |
| 67 class RenderWidgetHostView; | 67 class RenderWidgetHostView; |
| 68 class SiteInstance; | 68 class SiteInstance; |
| 69 class WebCursor; | |
| 70 struct DropData; | 69 struct DropData; |
| 71 | 70 |
| 72 // A browser plugin guest provides functionality for WebContents to operate in | 71 // A browser plugin guest provides functionality for WebContents to operate in |
| 73 // the guest role and implements guest-specific overrides for ViewHostMsg_* | 72 // the guest role and implements guest-specific overrides for ViewHostMsg_* |
| 74 // messages. | 73 // messages. |
| 75 // | 74 // |
| 76 // When a guest is initially created, it is in an unattached state. That is, | 75 // When a guest is initially created, it is in an unattached state. That is, |
| 77 // it is not visible anywhere and has no embedder WebContents assigned. | 76 // it is not visible anywhere and has no embedder WebContents assigned. |
| 78 // A BrowserPluginGuest is said to be "attached" if it has an embedder. | 77 // A BrowserPluginGuest is said to be "attached" if it has an embedder. |
| 79 // A BrowserPluginGuest can also create a new unattached guest via | 78 // A BrowserPluginGuest can also create a new unattached guest via |
| (...skipping 15 matching lines...) Expand all Loading... |
| 95 | 94 |
| 96 // Returns whether the given WebContents is a BrowserPlugin guest. | 95 // Returns whether the given WebContents is a BrowserPlugin guest. |
| 97 static bool IsGuest(WebContentsImpl* web_contents); | 96 static bool IsGuest(WebContentsImpl* web_contents); |
| 98 | 97 |
| 99 // Returns whether the given RenderviewHost is a BrowserPlugin guest. | 98 // Returns whether the given RenderviewHost is a BrowserPlugin guest. |
| 100 static bool IsGuest(RenderViewHostImpl* render_view_host); | 99 static bool IsGuest(RenderViewHostImpl* render_view_host); |
| 101 | 100 |
| 102 // Returns a WeakPtr to this BrowserPluginGuest. | 101 // Returns a WeakPtr to this BrowserPluginGuest. |
| 103 base::WeakPtr<BrowserPluginGuest> AsWeakPtr(); | 102 base::WeakPtr<BrowserPluginGuest> AsWeakPtr(); |
| 104 | 103 |
| 104 // Sets the focus state of the current RenderWidgetHostView. |
| 105 void SetFocus(RenderWidgetHost* rwh, bool focused); |
| 106 |
| 105 // Sets the lock state of the pointer. Returns true if |allowed| is true and | 107 // Sets the lock state of the pointer. Returns true if |allowed| is true and |
| 106 // the mouse has been successfully locked. | 108 // the mouse has been successfully locked. |
| 107 bool LockMouse(bool allowed); | 109 bool LockMouse(bool allowed); |
| 108 | 110 |
| 109 // Return true if the mouse is locked. | 111 // Return true if the mouse is locked. |
| 110 bool mouse_locked() const { return mouse_locked_; } | 112 bool mouse_locked() const { return mouse_locked_; } |
| 111 | 113 |
| 112 // Called when the embedder WebContents changes visibility. | 114 // Called when the embedder WebContents changes visibility. |
| 113 void EmbedderVisibilityChanged(bool visible); | 115 void EmbedderVisibilityChanged(bool visible); |
| 114 | 116 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 bool keep_selection); | 299 bool keep_selection); |
| 298 void OnExtendSelectionAndDelete(int instance_id, int before, int after); | 300 void OnExtendSelectionAndDelete(int instance_id, int before, int after); |
| 299 void OnImeCancelComposition(); | 301 void OnImeCancelComposition(); |
| 300 #if defined(OS_MACOSX) || defined(USE_AURA) | 302 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 301 void OnImeCompositionRangeChanged( | 303 void OnImeCompositionRangeChanged( |
| 302 const gfx::Range& range, | 304 const gfx::Range& range, |
| 303 const std::vector<gfx::Rect>& character_bounds); | 305 const std::vector<gfx::Rect>& character_bounds); |
| 304 #endif | 306 #endif |
| 305 | 307 |
| 306 // Message handlers for messages from guest. | 308 // Message handlers for messages from guest. |
| 307 | |
| 308 void OnDragStopped(); | |
| 309 void OnHandleInputEventAck( | 309 void OnHandleInputEventAck( |
| 310 blink::WebInputEvent::Type event_type, | 310 blink::WebInputEvent::Type event_type, |
| 311 InputEventAckState ack_result); | 311 InputEventAckState ack_result); |
| 312 void OnHasTouchEventHandlers(bool accept); | 312 void OnHasTouchEventHandlers(bool accept); |
| 313 void OnSetCursor(const WebCursor& cursor); | |
| 314 #if defined(OS_MACOSX) | 313 #if defined(OS_MACOSX) |
| 315 // On MacOS X popups are painted by the browser process. We handle them here | 314 // On MacOS X popups are painted by the browser process. We handle them here |
| 316 // so that they are positioned correctly. | 315 // so that they are positioned correctly. |
| 317 void OnShowPopup(RenderFrameHost* render_frame_host, | 316 void OnShowPopup(RenderFrameHost* render_frame_host, |
| 318 const FrameHostMsg_ShowPopup_Params& params); | 317 const FrameHostMsg_ShowPopup_Params& params); |
| 319 #endif | 318 #endif |
| 320 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 319 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
| 321 void OnTakeFocus(bool reverse); | 320 void OnTakeFocus(bool reverse); |
| 322 void OnUpdateFrameName(int frame_id, | 321 void OnUpdateFrameName(int frame_id, |
| 323 bool is_top_level, | 322 bool is_top_level, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 374 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
| 376 // permission. | 375 // permission. |
| 377 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 376 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
| 378 | 377 |
| 379 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 378 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 380 }; | 379 }; |
| 381 | 380 |
| 382 } // namespace content | 381 } // namespace content |
| 383 | 382 |
| 384 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 383 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |