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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 struct WebDropData; | 50 struct WebDropData; |
51 | 51 |
52 namespace WebKit { | 52 namespace WebKit { |
53 class WebInputEvent; | 53 class WebInputEvent; |
54 } | 54 } |
55 | 55 |
56 namespace content { | 56 namespace content { |
57 | 57 |
58 class BrowserPluginHostFactory; | 58 class BrowserPluginHostFactory; |
59 class BrowserPluginEmbedder; | 59 class BrowserPluginEmbedder; |
| 60 class DragEventSourceInfo; |
60 class RenderProcessHost; | 61 class RenderProcessHost; |
61 | 62 |
62 // A browser plugin guest provides functionality for WebContents to operate in | 63 // A browser plugin guest provides functionality for WebContents to operate in |
63 // the guest role and implements guest specific overrides for ViewHostMsg_* | 64 // the guest role and implements guest specific overrides for ViewHostMsg_* |
64 // messages. | 65 // messages. |
65 // | 66 // |
66 // BrowserPluginEmbedder is responsible for creating and destroying a guest. | 67 // BrowserPluginEmbedder is responsible for creating and destroying a guest. |
67 class CONTENT_EXPORT BrowserPluginGuest : public NotificationObserver, | 68 class CONTENT_EXPORT BrowserPluginGuest : public NotificationObserver, |
68 public WebContentsDelegate, | 69 public WebContentsDelegate, |
69 public WebContentsObserver { | 70 public WebContentsObserver { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 253 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
253 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 254 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
254 | 255 |
255 | 256 |
256 // Message handlers for messages from guest. | 257 // Message handlers for messages from guest. |
257 | 258 |
258 void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params, | 259 void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params, |
259 int* route_id, | 260 int* route_id, |
260 int* surface_id, | 261 int* surface_id, |
261 int64* cloned_session_storage_namespace_id); | 262 int64* cloned_session_storage_namespace_id); |
| 263 void OnDragStopped(); |
262 void OnHandleInputEventAck( | 264 void OnHandleInputEventAck( |
263 WebKit::WebInputEvent::Type event_type, | 265 WebKit::WebInputEvent::Type event_type, |
264 InputEventAckState ack_result); | 266 InputEventAckState ack_result); |
265 void OnHasTouchEventHandlers(bool accept); | 267 void OnHasTouchEventHandlers(bool accept); |
266 void OnSetCursor(const WebCursor& cursor); | 268 void OnSetCursor(const WebCursor& cursor); |
267 // On MacOSX popups are painted by the browser process. We handle them here | 269 // On MacOSX popups are painted by the browser process. We handle them here |
268 // so that they are positioned correctly. | 270 // so that they are positioned correctly. |
269 #if defined(OS_MACOSX) | 271 #if defined(OS_MACOSX) |
270 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 272 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
271 #endif | 273 #endif |
272 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 274 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
| 275 void OnStartDragging(bool* handled); |
273 // Overriden in tests. | 276 // Overriden in tests. |
274 virtual void OnTakeFocus(bool reverse); | 277 virtual void OnTakeFocus(bool reverse); |
275 void OnUpdateDragCursor(WebKit::WebDragOperation operation); | |
276 void OnUpdateFrameName(int frame_id, | 278 void OnUpdateFrameName(int frame_id, |
277 bool is_top_level, | 279 bool is_top_level, |
278 const std::string& name); | 280 const std::string& name); |
279 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 281 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
280 | 282 |
281 // Static factory instance (always NULL for non-test). | 283 // Static factory instance (always NULL for non-test). |
282 static content::BrowserPluginHostFactory* factory_; | 284 static content::BrowserPluginHostFactory* factory_; |
283 | 285 |
284 NotificationRegistrar notification_registrar_; | 286 NotificationRegistrar notification_registrar_; |
285 WebContentsImpl* embedder_web_contents_; | 287 WebContentsImpl* embedder_web_contents_; |
(...skipping 15 matching lines...) Expand all Loading... |
301 bool auto_size_enabled_; | 303 bool auto_size_enabled_; |
302 gfx::Size max_auto_size_; | 304 gfx::Size max_auto_size_; |
303 gfx::Size min_auto_size_; | 305 gfx::Size min_auto_size_; |
304 | 306 |
305 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 307 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
306 }; | 308 }; |
307 | 309 |
308 } // namespace content | 310 } // namespace content |
309 | 311 |
310 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 312 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |