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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void RenderProcessGone(base::TerminationStatus status) override; | 164 void RenderProcessGone(base::TerminationStatus status) override; |
165 bool OnMessageReceived(const IPC::Message& message) override; | 165 bool OnMessageReceived(const IPC::Message& message) override; |
166 bool OnMessageReceived(const IPC::Message& message, | 166 bool OnMessageReceived(const IPC::Message& message, |
167 RenderFrameHost* render_frame_host) override; | 167 RenderFrameHost* render_frame_host) override; |
168 | 168 |
169 // Exposes the protected web_contents() from WebContentsObserver. | 169 // Exposes the protected web_contents() from WebContentsObserver. |
170 WebContentsImpl* GetWebContents() const; | 170 WebContentsImpl* GetWebContents() const; |
171 | 171 |
172 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; | 172 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; |
173 | 173 |
174 // Helper to send messages to embedder. This methods fills the message with | 174 // Helper to send messages to embedder. If this guest is not yet attached, |
175 // the correct routing id. | 175 // then IPCs will be queued until attachment. |
176 void SendMessageToEmbedder(IPC::Message* msg); | 176 void SendMessageToEmbedder(IPC::Message* msg); |
177 | 177 |
178 // Returns whether the guest is attached to an embedder. | 178 // Returns whether the guest is attached to an embedder. |
179 bool attached() const { return attached_; } | 179 bool attached() const { return attached_; } |
180 | 180 |
181 // Attaches this BrowserPluginGuest to the provided |embedder_web_contents| | 181 // Attaches this BrowserPluginGuest to the provided |embedder_web_contents| |
182 // and initializes the guest with the provided |params|. Attaching a guest | 182 // and initializes the guest with the provided |params|. Attaching a guest |
183 // to an embedder implies that this guest's lifetime is no longer managed | 183 // to an embedder implies that this guest's lifetime is no longer managed |
184 // by its opener, and it can begin loading resources. | 184 // by its opener, and it can begin loading resources. |
185 void Attach(int browser_plugin_instance_id, | 185 void Attach(int browser_plugin_instance_id, |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 400 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
401 // permission. | 401 // permission. |
402 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 402 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
403 | 403 |
404 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 404 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
405 }; | 405 }; |
406 | 406 |
407 } // namespace content | 407 } // namespace content |
408 | 408 |
409 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 409 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |