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. It has a | 9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a |
10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The | 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 const FileChooserParams& params) OVERRIDE; | 188 const FileChooserParams& params) OVERRIDE; |
189 virtual bool ShouldFocusPageAfterCrash() OVERRIDE; | 189 virtual bool ShouldFocusPageAfterCrash() OVERRIDE; |
190 virtual void RequestMediaAccessPermission( | 190 virtual void RequestMediaAccessPermission( |
191 WebContents* web_contents, | 191 WebContents* web_contents, |
192 const MediaStreamRequest& request, | 192 const MediaStreamRequest& request, |
193 const MediaResponseCallback& callback) OVERRIDE; | 193 const MediaResponseCallback& callback) OVERRIDE; |
194 | 194 |
195 // Exposes the protected web_contents() from WebContentsObserver. | 195 // Exposes the protected web_contents() from WebContentsObserver. |
196 WebContentsImpl* GetWebContents(); | 196 WebContentsImpl* GetWebContents(); |
197 | 197 |
198 // Kill the guest process. | |
199 void Terminate(); | |
200 | |
201 // Overridden in tests. | 198 // Overridden in tests. |
202 virtual void SetDamageBuffer( | 199 virtual void SetDamageBuffer( |
203 const BrowserPluginHostMsg_ResizeGuest_Params& params); | 200 const BrowserPluginHostMsg_ResizeGuest_Params& params); |
204 | 201 |
205 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; | 202 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; |
206 | 203 |
207 // Helper to send messages to embedder. This methods fills the message with | 204 // Helper to send messages to embedder. This methods fills the message with |
208 // the correct routing id. | 205 // the correct routing id. |
209 // Overridden in test implementation since we want to intercept certain | 206 // Overridden in test implementation since we want to intercept certain |
210 // messages for testing. | 207 // messages for testing. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void OnHandleInputEventAck( | 366 void OnHandleInputEventAck( |
370 WebKit::WebInputEvent::Type event_type, | 367 WebKit::WebInputEvent::Type event_type, |
371 InputEventAckState ack_result); | 368 InputEventAckState ack_result); |
372 void OnHasTouchEventHandlers(bool accept); | 369 void OnHasTouchEventHandlers(bool accept); |
373 void OnSetCursor(const WebCursor& cursor); | 370 void OnSetCursor(const WebCursor& cursor); |
374 // On MacOSX popups are painted by the browser process. We handle them here | 371 // On MacOSX popups are painted by the browser process. We handle them here |
375 // so that they are positioned correctly. | 372 // so that they are positioned correctly. |
376 #if defined(OS_MACOSX) | 373 #if defined(OS_MACOSX) |
377 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 374 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
378 #endif | 375 #endif |
379 void OnShowView(int route_id, | |
380 WindowOpenDisposition disposition, | |
381 const gfx::Rect& initial_bounds, | |
382 bool user_gesture); | |
383 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 376 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
384 // Overriden in tests. | 377 // Overriden in tests. |
385 virtual void OnTakeFocus(bool reverse); | 378 virtual void OnTakeFocus(bool reverse); |
386 void OnUpdateDragCursor(WebKit::WebDragOperation operation); | 379 void OnUpdateDragCursor(WebKit::WebDragOperation operation); |
387 void OnUpdateFrameName(int frame_id, | 380 void OnUpdateFrameName(int frame_id, |
388 bool is_top_level, | 381 bool is_top_level, |
389 const std::string& name); | 382 const std::string& name); |
390 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 383 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
391 | 384 |
392 // Helpers for |OnRespondPermission|. | 385 // Helpers for |OnRespondPermission|. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 445 |
453 typedef std::map<int, base::Callback<void(bool)> > DownloadRequestMap; | 446 typedef std::map<int, base::Callback<void(bool)> > DownloadRequestMap; |
454 DownloadRequestMap download_request_callback_map_; | 447 DownloadRequestMap download_request_callback_map_; |
455 | 448 |
456 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 449 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
457 }; | 450 }; |
458 | 451 |
459 } // namespace content | 452 } // namespace content |
460 | 453 |
461 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 454 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |