| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 virtual void OnHandleInputEvent(int instance_id, | 315 virtual void OnHandleInputEvent(int instance_id, |
| 316 const gfx::Rect& guest_window_rect, | 316 const gfx::Rect& guest_window_rect, |
| 317 const blink::WebInputEvent* event); | 317 const blink::WebInputEvent* event); |
| 318 void OnLockMouse(bool user_gesture, | 318 void OnLockMouse(bool user_gesture, |
| 319 bool last_unlocked_by_target, | 319 bool last_unlocked_by_target, |
| 320 bool privileged); | 320 bool privileged); |
| 321 void OnLockMouseAck(int instance_id, bool succeeded); | 321 void OnLockMouseAck(int instance_id, bool succeeded); |
| 322 void OnNavigateGuest(int instance_id, const std::string& src); | 322 void OnNavigateGuest(int instance_id, const std::string& src); |
| 323 void OnPluginDestroyed(int instance_id); | 323 void OnPluginDestroyed(int instance_id); |
| 324 // Resizes the guest's web contents. | 324 // Resizes the guest's web contents. |
| 325 // Overridden in tests. | 325 void OnResizeGuest( |
| 326 virtual void OnResizeGuest( | |
| 327 int instance_id, const BrowserPluginHostMsg_ResizeGuest_Params& params); | 326 int instance_id, const BrowserPluginHostMsg_ResizeGuest_Params& params); |
| 328 // Overridden in tests. | 327 void OnSetFocus(int instance_id, bool focused); |
| 329 virtual void OnSetFocus(int instance_id, bool focused); | 328 // Sets the name of the guest so that other guests in the same partition can |
| 329 // access it. |
| 330 void OnSetName(int instance_id, const std::string& name); |
| 330 // Updates the size state of the guest. | 331 // Updates the size state of the guest. |
| 331 void OnSetSize( | 332 void OnSetSize( |
| 332 int instance_id, | 333 int instance_id, |
| 333 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 334 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 334 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 335 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
| 335 void OnSetEditCommandsForNextKeyEvent( | 336 void OnSetEditCommandsForNextKeyEvent( |
| 336 int instance_id, | 337 int instance_id, |
| 337 const std::vector<EditCommand>& edit_commands); | 338 const std::vector<EditCommand>& edit_commands); |
| 338 void OnSetContentsOpaque(int instance_id, bool opaque); | 339 void OnSetContentsOpaque(int instance_id, bool opaque); |
| 339 // The guest WebContents is visible if both its embedder is visible and | 340 // The guest WebContents is visible if both its embedder is visible and |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 blink::WebInputEvent::Type event_type, | 386 blink::WebInputEvent::Type event_type, |
| 386 InputEventAckState ack_result); | 387 InputEventAckState ack_result); |
| 387 void OnHasTouchEventHandlers(bool accept); | 388 void OnHasTouchEventHandlers(bool accept); |
| 388 void OnSetCursor(const WebCursor& cursor); | 389 void OnSetCursor(const WebCursor& cursor); |
| 389 // On MacOSX popups are painted by the browser process. We handle them here | 390 // On MacOSX popups are painted by the browser process. We handle them here |
| 390 // so that they are positioned correctly. | 391 // so that they are positioned correctly. |
| 391 #if defined(OS_MACOSX) | 392 #if defined(OS_MACOSX) |
| 392 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 393 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
| 393 #endif | 394 #endif |
| 394 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 395 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
| 395 // Overridden in tests. | 396 void OnTakeFocus(bool reverse); |
| 396 virtual void OnTakeFocus(bool reverse); | 397 void OnUpdateFrameName(int frame_id, |
| 398 bool is_top_level, |
| 399 const std::string& name); |
| 397 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 400 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
| 398 | 401 |
| 399 // Forwards all messages from the |pending_messages_| queue to the embedder. | 402 // Forwards all messages from the |pending_messages_| queue to the embedder. |
| 400 void SendQueuedMessages(); | 403 void SendQueuedMessages(); |
| 401 | 404 |
| 402 // Static factory instance (always NULL for non-test). | 405 // Static factory instance (always NULL for non-test). |
| 403 static BrowserPluginHostFactory* factory_; | 406 static BrowserPluginHostFactory* factory_; |
| 404 | 407 |
| 405 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; | 408 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; |
| 406 WebContentsImpl* embedder_web_contents_; | 409 WebContentsImpl* embedder_web_contents_; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 459 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
| 457 // permission. | 460 // permission. |
| 458 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 461 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
| 459 | 462 |
| 460 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 463 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 461 }; | 464 }; |
| 462 | 465 |
| 463 } // namespace content | 466 } // namespace content |
| 464 | 467 |
| 465 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 468 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |