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. 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 11 matching lines...) Expand all Loading... | |
| 22 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 22 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| 23 | 23 |
| 24 #include <map> | 24 #include <map> |
| 25 #include <queue> | 25 #include <queue> |
| 26 | 26 |
| 27 #include "base/compiler_specific.h" | 27 #include "base/compiler_specific.h" |
| 28 #include "base/id_map.h" | 28 #include "base/id_map.h" |
| 29 #include "base/memory/shared_memory.h" | 29 #include "base/memory/shared_memory.h" |
| 30 #include "base/memory/weak_ptr.h" | 30 #include "base/memory/weak_ptr.h" |
| 31 #include "base/values.h" | 31 #include "base/values.h" |
| 32 #include "content/common/browser_plugin/browser_plugin_message_enums.h" | |
| 33 #include "content/common/edit_command.h" | 32 #include "content/common/edit_command.h" |
| 34 #include "content/port/common/input_event_ack_state.h" | 33 #include "content/port/common/input_event_ack_state.h" |
| 35 #include "content/public/browser/browser_plugin_guest_delegate.h" | 34 #include "content/public/browser/browser_plugin_guest_delegate.h" |
| 36 #include "content/public/browser/javascript_dialog_manager.h" | 35 #include "content/public/browser/javascript_dialog_manager.h" |
| 37 #include "content/public/browser/notification_observer.h" | 36 #include "content/public/browser/notification_observer.h" |
| 38 #include "content/public/browser/notification_registrar.h" | 37 #include "content/public/browser/notification_registrar.h" |
| 39 #include "content/public/browser/render_view_host_observer.h" | 38 #include "content/public/browser/render_view_host_observer.h" |
| 40 #include "content/public/browser/web_contents_delegate.h" | 39 #include "content/public/browser/web_contents_delegate.h" |
| 41 #include "content/public/browser/web_contents_observer.h" | 40 #include "content/public/browser/web_contents_observer.h" |
| 41 #include "content/public/common/browser_plugin/browser_plugin_message_enums.h" | |
| 42 #include "third_party/WebKit/public/web/WebDragOperation.h" | 42 #include "third_party/WebKit/public/web/WebDragOperation.h" |
| 43 #include "third_party/WebKit/public/web/WebDragStatus.h" | 43 #include "third_party/WebKit/public/web/WebDragStatus.h" |
| 44 #include "third_party/WebKit/public/web/WebInputEvent.h" | 44 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 45 #include "ui/gfx/rect.h" | 45 #include "ui/gfx/rect.h" |
| 46 #include "ui/surface/transport_dib.h" | 46 #include "ui/surface/transport_dib.h" |
| 47 | 47 |
| 48 struct BrowserPluginHostMsg_AutoSize_Params; | 48 struct BrowserPluginHostMsg_AutoSize_Params; |
| 49 struct BrowserPluginHostMsg_Attach_Params; | 49 struct BrowserPluginHostMsg_Attach_Params; |
| 50 struct BrowserPluginHostMsg_ResizeGuest_Params; | 50 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 51 struct ViewHostMsg_CreateWindow_Params; | 51 struct ViewHostMsg_CreateWindow_Params; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 | 275 |
| 276 void DragSourceMovedTo(int client_x, int client_y, | 276 void DragSourceMovedTo(int client_x, int client_y, |
| 277 int screen_x, int screen_y); | 277 int screen_x, int screen_y); |
| 278 | 278 |
| 279 // Called when the drag started by this guest ends at an OS-level. | 279 // Called when the drag started by this guest ends at an OS-level. |
| 280 void EndSystemDrag(); | 280 void EndSystemDrag(); |
| 281 | 281 |
| 282 // |this| takes ownership of |delegate|. | 282 // |this| takes ownership of |delegate|. |
| 283 void SetDelegate(BrowserPluginGuestDelegate* delegate); | 283 void SetDelegate(BrowserPluginGuestDelegate* delegate); |
| 284 | 284 |
| 285 void RespondToPermissionRequest( | |
| 286 int request_id, | |
|
lazyboy
2013/08/05 09:26:58
nit: can fit in previous line.
Fady Samuel
2013/08/06 07:14:40
Done.
| |
| 287 bool should_allow, | |
| 288 const std::string& user_input); | |
| 289 | |
| 285 private: | 290 private: |
| 286 class EmbedderRenderViewHostObserver; | 291 class EmbedderRenderViewHostObserver; |
| 287 friend class TestBrowserPluginGuest; | 292 friend class TestBrowserPluginGuest; |
| 288 | 293 |
| 289 class DownloadRequest; | 294 class DownloadRequest; |
| 290 class GeolocationRequest; | 295 class GeolocationRequest; |
| 291 class JavaScriptDialogRequest; | 296 class JavaScriptDialogRequest; |
| 292 // MediaRequest because of naming conflicts with MediaStreamRequest. | 297 // MediaRequest because of naming conflicts with MediaStreamRequest. |
| 293 class MediaRequest; | 298 class MediaRequest; |
| 294 class NewWindowRequest; | 299 class NewWindowRequest; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 bool user_gesture); | 337 bool user_gesture); |
| 333 | 338 |
| 334 // Message handlers for messages from embedder. | 339 // Message handlers for messages from embedder. |
| 335 | 340 |
| 336 void OnCompositorFrameACK(int instance_id, | 341 void OnCompositorFrameACK(int instance_id, |
| 337 int route_id, | 342 int route_id, |
| 338 uint32 output_surface_id, | 343 uint32 output_surface_id, |
| 339 int renderer_host_id, | 344 int renderer_host_id, |
| 340 const cc::CompositorFrameAck& ack); | 345 const cc::CompositorFrameAck& ack); |
| 341 | 346 |
| 342 // Allows or denies a permission request access, after the embedder has had a | |
| 343 // chance to decide. | |
| 344 void OnRespondPermission(int instance_id, | |
| 345 int request_id, | |
| 346 bool should_allow, | |
| 347 const std::string& user_input); | |
| 348 // Handles drag events from the embedder. | 347 // Handles drag events from the embedder. |
| 349 // When dragging, the drag events go to the embedder first, and if the drag | 348 // When dragging, the drag events go to the embedder first, and if the drag |
| 350 // happens on the browser plugin, then the plugin sends a corresponding | 349 // happens on the browser plugin, then the plugin sends a corresponding |
| 351 // drag-message to the guest. This routes the drag-message to the guest | 350 // drag-message to the guest. This routes the drag-message to the guest |
| 352 // renderer. | 351 // renderer. |
| 353 void OnDragStatusUpdate(int instance_id, | 352 void OnDragStatusUpdate(int instance_id, |
| 354 WebKit::WebDragStatus drag_status, | 353 WebKit::WebDragStatus drag_status, |
| 355 const DropData& drop_data, | 354 const DropData& drop_data, |
| 356 WebKit::WebDragOperationsMask drag_mask, | 355 WebKit::WebDragOperationsMask drag_mask, |
| 357 const gfx::Point& location); | 356 const gfx::Point& location); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 522 std::queue<IPC::Message*> pending_messages_; | 521 std::queue<IPC::Message*> pending_messages_; |
| 523 | 522 |
| 524 scoped_ptr<BrowserPluginGuestDelegate> delegate_; | 523 scoped_ptr<BrowserPluginGuestDelegate> delegate_; |
| 525 | 524 |
| 526 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 525 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 527 }; | 526 }; |
| 528 | 527 |
| 529 } // namespace content | 528 } // namespace content |
| 530 | 529 |
| 531 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 530 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |