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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // Called by the content embedder when a guest exists with the provided | 91 // Called by the content embedder when a guest exists with the provided |
92 // |instance_id|. | 92 // |instance_id|. |
93 void OnGuestCallback(int instance_id, | 93 void OnGuestCallback(int instance_id, |
94 const BrowserPluginHostMsg_Attach_Params& params, | 94 const BrowserPluginHostMsg_Attach_Params& params, |
95 const base::DictionaryValue* extra_params, | 95 const base::DictionaryValue* extra_params, |
96 WebContents* guest_web_contents); | 96 WebContents* guest_web_contents); |
97 | 97 |
98 // Message handlers. | 98 // Message handlers. |
99 | 99 |
100 void OnAllocateInstanceID(int request_id); | |
101 void OnAttach(int instance_id, | 100 void OnAttach(int instance_id, |
102 const BrowserPluginHostMsg_Attach_Params& params, | 101 const BrowserPluginHostMsg_Attach_Params& params, |
103 const base::DictionaryValue& extra_params); | 102 const base::DictionaryValue& extra_params); |
104 void OnPluginAtPositionResponse(int instance_id, | 103 void OnPluginAtPositionResponse(int instance_id, |
105 int request_id, | 104 int request_id, |
106 const gfx::Point& position); | 105 const gfx::Point& position); |
107 | 106 |
108 // Static factory instance (always NULL for non-test). | 107 // Static factory instance (always NULL for non-test). |
109 static BrowserPluginHostFactory* factory_; | 108 static BrowserPluginHostFactory* factory_; |
110 | 109 |
111 // Used to correctly update the cursor when dragging over a guest, and to | 110 // Used to correctly update the cursor when dragging over a guest, and to |
112 // handle a race condition when dropping onto the guest that started the drag | 111 // handle a race condition when dropping onto the guest that started the drag |
113 // (the race is that the dragend message arrives before the drop message so | 112 // (the race is that the dragend message arrives before the drop message so |
114 // the drop never takes place). | 113 // the drop never takes place). |
115 // crbug.com/233571 | 114 // crbug.com/233571 |
116 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; | 115 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; |
117 | 116 |
118 // Pointer to the guest that started the drag, used to forward necessary drag | 117 // Pointer to the guest that started the drag, used to forward necessary drag |
119 // status messages to the correct guest. | 118 // status messages to the correct guest. |
120 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 119 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
121 | 120 |
122 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 121 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
123 | 122 |
124 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 123 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
125 }; | 124 }; |
126 | 125 |
127 } // namespace content | 126 } // namespace content |
128 | 127 |
129 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 128 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |