Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.h

Issue 618823002: GuestView: Move lifetime management out of content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 // The is the routing ID for a swapped out RenderView for the guest
364 // WebContents in the embedder's process.
365 int guest_proxy_routing_id_;
366
368 // This is a queue of messages that are destined to be sent to the embedder 367 // 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. 368 // once the guest is attached to a particular embedder.
370 std::deque<linked_ptr<IPC::Message> > pending_messages_; 369 std::deque<linked_ptr<IPC::Message> > pending_messages_;
371 370
372 BrowserPluginGuestDelegate* const delegate_; 371 BrowserPluginGuestDelegate* const delegate_;
373 372
374 // Weak pointer used to ask GeolocationPermissionContext about geolocation 373 // Weak pointer used to ask GeolocationPermissionContext about geolocation
375 // permission. 374 // permission.
376 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; 375 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_;
377 376
378 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); 377 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest);
379 }; 378 };
380 379
381 } // namespace content 380 } // namespace content
382 381
383 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ 382 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698