| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 static BrowserPluginGuest* CreateWithOpener( | 99 static BrowserPluginGuest* CreateWithOpener( |
| 100 int instance_id, | 100 int instance_id, |
| 101 bool has_render_view, | 101 bool has_render_view, |
| 102 WebContentsImpl* web_contents, | 102 WebContentsImpl* web_contents, |
| 103 BrowserPluginGuest* opener); | 103 BrowserPluginGuest* opener); |
| 104 | 104 |
| 105 // Returns a WeakPtr to this BrowserPluginGuest. | 105 // Returns a WeakPtr to this BrowserPluginGuest. |
| 106 base::WeakPtr<BrowserPluginGuest> AsWeakPtr(); | 106 base::WeakPtr<BrowserPluginGuest> AsWeakPtr(); |
| 107 | 107 |
| 108 // Sets the lock state of the pointer. Returns true if |allowed| is true and |
| 109 // the mouse has been successfully locked. |
| 110 bool LockMouse(bool allowed); |
| 111 |
| 108 // Called when the embedder WebContents is destroyed to give the | 112 // Called when the embedder WebContents is destroyed to give the |
| 109 // BrowserPluginGuest an opportunity to clean up after itself. | 113 // BrowserPluginGuest an opportunity to clean up after itself. |
| 110 void EmbedderDestroyed(); | 114 void EmbedderDestroyed(); |
| 111 | 115 |
| 112 // Called when the embedder WebContents changes visibility. | 116 // Called when the embedder WebContents changes visibility. |
| 113 void EmbedderVisibilityChanged(bool visible); | 117 void EmbedderVisibilityChanged(bool visible); |
| 114 | 118 |
| 115 // Destroys the guest WebContents and all its associated state, including | 119 // Destroys the guest WebContents and all its associated state, including |
| 116 // this BrowserPluginGuest, and its new unattached windows. | 120 // this BrowserPluginGuest, and its new unattached windows. |
| 117 void Destroy(); | 121 void Destroy(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 133 // Returns NULL otherwise. | 137 // Returns NULL otherwise. |
| 134 RenderWidgetHostView* GetEmbedderRenderWidgetHostView(); | 138 RenderWidgetHostView* GetEmbedderRenderWidgetHostView(); |
| 135 | 139 |
| 136 bool focused() const { return focused_; } | 140 bool focused() const { return focused_; } |
| 137 bool visible() const { return guest_visible_; } | 141 bool visible() const { return guest_visible_; } |
| 138 bool is_in_destruction() { return is_in_destruction_; } | 142 bool is_in_destruction() { return is_in_destruction_; } |
| 139 | 143 |
| 140 // Returns the BrowserPluginGuest that created this guest, if any. | 144 // Returns the BrowserPluginGuest that created this guest, if any. |
| 141 BrowserPluginGuest* GetOpener() const; | 145 BrowserPluginGuest* GetOpener() const; |
| 142 | 146 |
| 143 // Returns whether the mouse pointer was unlocked. | |
| 144 bool UnlockMouseIfNecessary(const NativeWebKeyboardEvent& event); | |
| 145 | |
| 146 void UpdateVisibility(); | 147 void UpdateVisibility(); |
| 147 | 148 |
| 148 void CopyFromCompositingSurface( | 149 void CopyFromCompositingSurface( |
| 149 gfx::Rect src_subrect, | 150 gfx::Rect src_subrect, |
| 150 gfx::Size dst_size, | 151 gfx::Size dst_size, |
| 151 const base::Callback<void(bool, const SkBitmap&)>& callback); | 152 const base::Callback<void(bool, const SkBitmap&)>& callback); |
| 152 | 153 |
| 153 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; | 154 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; |
| 154 | 155 |
| 155 // WebContentsObserver implementation. | 156 // WebContentsObserver implementation. |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 522 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
| 522 // permission. | 523 // permission. |
| 523 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 524 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
| 524 | 525 |
| 525 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 526 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 526 }; | 527 }; |
| 527 | 528 |
| 528 } // namespace content | 529 } // namespace content |
| 529 | 530 |
| 530 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 531 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |