| 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 BrowserPluginEmbedder handles messages coming from a BrowserPlugin's | 5 // A BrowserPluginEmbedder handles messages coming from a BrowserPlugin's |
| 6 // embedder that are not directed at any particular existing guest process. | 6 // embedder that are not directed at any particular existing guest process. |
| 7 // In the beginning, when a BrowserPlugin instance in the embedder renderer | 7 // In the beginning, when a BrowserPlugin instance in the embedder renderer |
| 8 // process requests an initial navigation, the WebContents for that renderer | 8 // process requests an initial navigation, the WebContents for that renderer |
| 9 // renderer creates a BrowserPluginEmbedder for itself. The | 9 // renderer creates a BrowserPluginEmbedder for itself. The |
| 10 // BrowserPluginEmbedder, in turn, forwards the requests to a | 10 // BrowserPluginEmbedder, in turn, forwards the requests to a |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Called by the content embedder when a guest exists with the provided | 94 // Called by the content embedder when a guest exists with the provided |
| 95 // |instance_id|. | 95 // |instance_id|. |
| 96 void OnGuestCallback(int instance_id, | 96 void OnGuestCallback(int instance_id, |
| 97 const BrowserPluginHostMsg_Attach_Params& params, | 97 const BrowserPluginHostMsg_Attach_Params& params, |
| 98 const base::DictionaryValue* extra_params, | 98 const base::DictionaryValue* extra_params, |
| 99 WebContents* guest_web_contents); | 99 WebContents* guest_web_contents); |
| 100 | 100 |
| 101 // Message handlers. | 101 // Message handlers. |
| 102 | 102 |
| 103 void OnAllocateInstanceID(int request_id); | |
| 104 void OnAttach(int instance_id, | 103 void OnAttach(int instance_id, |
| 105 const BrowserPluginHostMsg_Attach_Params& params, | 104 const BrowserPluginHostMsg_Attach_Params& params, |
| 106 const base::DictionaryValue& extra_params); | 105 const base::DictionaryValue& extra_params); |
| 107 void OnPluginAtPositionResponse(int instance_id, | 106 void OnPluginAtPositionResponse(int instance_id, |
| 108 int request_id, | 107 int request_id, |
| 109 const gfx::Point& position); | 108 const gfx::Point& position); |
| 110 | 109 |
| 111 // Static factory instance (always NULL for non-test). | 110 // Static factory instance (always NULL for non-test). |
| 112 static BrowserPluginHostFactory* factory_; | 111 static BrowserPluginHostFactory* factory_; |
| 113 | 112 |
| 114 // Used to correctly update the cursor when dragging over a guest, and to | 113 // Used to correctly update the cursor when dragging over a guest, and to |
| 115 // handle a race condition when dropping onto the guest that started the drag | 114 // handle a race condition when dropping onto the guest that started the drag |
| 116 // (the race is that the dragend message arrives before the drop message so | 115 // (the race is that the dragend message arrives before the drop message so |
| 117 // the drop never takes place). | 116 // the drop never takes place). |
| 118 // crbug.com/233571 | 117 // crbug.com/233571 |
| 119 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; | 118 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; |
| 120 | 119 |
| 121 // Pointer to the guest that started the drag, used to forward necessary drag | 120 // Pointer to the guest that started the drag, used to forward necessary drag |
| 122 // status messages to the correct guest. | 121 // status messages to the correct guest. |
| 123 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 122 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
| 124 | 123 |
| 125 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 124 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
| 126 | 125 |
| 127 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 126 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 } // namespace content | 129 } // namespace content |
| 131 | 130 |
| 132 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 131 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
| OLD | NEW |