Chromium Code Reviews| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 // 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 |
| 108 // the mouse has been successfully locked. | 108 // the mouse has been successfully locked. |
| 109 bool LockMouse(bool allowed); | 109 bool LockMouse(bool allowed); |
| 110 | 110 |
| 111 // Return true if the mouse is locked. | 111 // Return true if the mouse is locked. |
| 112 bool mouse_locked() const { return mouse_locked_; } | 112 bool mouse_locked() const { return mouse_locked_; } |
| 113 | 113 |
| 114 // Called when the embedder WebContents changes visibility. | 114 // Called when the embedder WebContents changes visibility. |
| 115 void EmbedderVisibilityChanged(bool visible); | 115 void EmbedderVisibilityChanged(bool visible); |
| 116 | 116 |
| 117 // Destroys the guest WebContents and all its associated state, including | |
| 118 // this BrowserPluginGuest, and its new unattached windows. | |
| 119 void Destroy(); | |
| 120 | |
| 121 // Creates a new guest WebContentsImpl with the provided |params| with |this| | 117 // Creates a new guest WebContentsImpl with the provided |params| with |this| |
| 122 // as the |opener|. | 118 // as the |opener|. |
| 123 WebContentsImpl* CreateNewGuestWindow( | 119 WebContentsImpl* CreateNewGuestWindow( |
| 124 const WebContents::CreateParams& params); | 120 const WebContents::CreateParams& params); |
| 125 | 121 |
| 126 // Returns the identifier that uniquely identifies a browser plugin guest | 122 // Returns the identifier that uniquely identifies a browser plugin guest |
| 127 // within an embedder. | 123 // within an embedder. |
| 128 int browser_plugin_instance_id() const { return browser_plugin_instance_id_; } | 124 int browser_plugin_instance_id() const { return browser_plugin_instance_id_; } |
| 129 | 125 |
| 130 bool OnMessageReceivedFromEmbedder(const IPC::Message& message); | 126 bool OnMessageReceivedFromEmbedder(const IPC::Message& message); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 | 242 |
| 247 // Returns compositor resources reclaimed in the embedder to the guest. | 243 // Returns compositor resources reclaimed in the embedder to the guest. |
| 248 void OnReclaimCompositorResources( | 244 void OnReclaimCompositorResources( |
| 249 int instance_id, | 245 int instance_id, |
| 250 const FrameHostMsg_ReclaimCompositorResources_Params& params); | 246 const FrameHostMsg_ReclaimCompositorResources_Params& params); |
| 251 | 247 |
| 252 void OnLockMouse(bool user_gesture, | 248 void OnLockMouse(bool user_gesture, |
| 253 bool last_unlocked_by_target, | 249 bool last_unlocked_by_target, |
| 254 bool privileged); | 250 bool privileged); |
| 255 void OnLockMouseAck(int instance_id, bool succeeded); | 251 void OnLockMouseAck(int instance_id, bool succeeded); |
| 256 void OnPluginDestroyed(int instance_id); | |
| 257 // Resizes the guest's web contents. | 252 // Resizes the guest's web contents. |
| 258 void OnResizeGuest( | 253 void OnResizeGuest( |
| 259 int instance_id, const BrowserPluginHostMsg_ResizeGuest_Params& params); | 254 int instance_id, const BrowserPluginHostMsg_ResizeGuest_Params& params); |
| 260 void OnSetFocus(int instance_id, bool focused); | 255 void OnSetFocus(int instance_id, bool focused); |
| 261 // Sets the name of the guest so that other guests in the same partition can | 256 // Sets the name of the guest so that other guests in the same partition can |
| 262 // access it. | 257 // access it. |
| 263 void OnSetName(int instance_id, const std::string& name); | 258 void OnSetName(int instance_id, const std::string& name); |
| 264 // Updates the size state of the guest. | 259 // Updates the size state of the guest. |
| 265 void OnSetEditCommandsForNextKeyEvent( | 260 void OnSetEditCommandsForNextKeyEvent( |
| 266 int instance_id, | 261 int instance_id, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 // Last seen size of BrowserPlugin (by OnResizeGuest). | 353 // Last seen size of BrowserPlugin (by OnResizeGuest). |
| 359 gfx::Size last_seen_browser_plugin_size_; | 354 gfx::Size last_seen_browser_plugin_size_; |
| 360 | 355 |
| 361 bool is_in_destruction_; | 356 bool is_in_destruction_; |
| 362 | 357 |
| 363 // Text input type states. | 358 // Text input type states. |
| 364 ui::TextInputType last_text_input_type_; | 359 ui::TextInputType last_text_input_type_; |
| 365 ui::TextInputMode last_input_mode_; | 360 ui::TextInputMode last_input_mode_; |
| 366 bool last_can_compose_inline_; | 361 bool last_can_compose_inline_; |
| 367 | 362 |
| 363 int guest_proxy_routing_id_; | |
|
Charlie Reis
2014/10/01 17:11:00
nit: Please document what this is.
Fady Samuel
2014/10/01 21:40:53
Done.
| |
| 364 | |
| 368 // This is a queue of messages that are destined to be sent to the embedder | 365 // This is a queue of messages that are destined to be sent to the embedder |
| 369 // once the guest is attached to a particular embedder. | 366 // once the guest is attached to a particular embedder. |
| 370 std::deque<linked_ptr<IPC::Message> > pending_messages_; | 367 std::deque<linked_ptr<IPC::Message> > pending_messages_; |
| 371 | 368 |
| 372 BrowserPluginGuestDelegate* const delegate_; | 369 BrowserPluginGuestDelegate* const delegate_; |
| 373 | 370 |
| 374 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 371 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
| 375 // permission. | 372 // permission. |
| 376 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 373 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
| 377 | 374 |
| 378 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 375 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 379 }; | 376 }; |
| 380 | 377 |
| 381 } // namespace content | 378 } // namespace content |
| 382 | 379 |
| 383 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 380 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |