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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); | 78 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); |
79 | 79 |
80 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents); | 80 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents); |
81 | 81 |
82 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest); | 82 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest); |
83 | 83 |
84 // Called by the content embedder when a guest exists with the provided | 84 // Called by the content embedder when a guest exists with the provided |
85 // |instance_id|. | 85 // |instance_id|. |
86 void OnGuestCallback(int instance_id, | 86 void OnGuestCallback(int instance_id, |
87 const BrowserPluginHostMsg_Attach_Params& params, | 87 const BrowserPluginHostMsg_Attach_Params& params, |
88 const base::DictionaryValue* extra_params, | |
89 WebContents* guest_web_contents); | 88 WebContents* guest_web_contents); |
90 | 89 |
91 // Message handlers. | 90 // Message handlers. |
92 | 91 |
93 void OnAttach(int instance_id, | 92 void OnAttach(int instance_id, |
94 const BrowserPluginHostMsg_Attach_Params& params, | 93 const BrowserPluginHostMsg_Attach_Params& params); |
95 const base::DictionaryValue& extra_params); | |
96 void OnPluginAtPositionResponse(int instance_id, | 94 void OnPluginAtPositionResponse(int instance_id, |
97 int request_id, | 95 int request_id, |
98 const gfx::Point& position); | 96 const gfx::Point& position); |
99 | 97 |
100 // Used to correctly update the cursor when dragging over a guest, and to | 98 // Used to correctly update the cursor when dragging over a guest, and to |
101 // handle a race condition when dropping onto the guest that started the drag | 99 // handle a race condition when dropping onto the guest that started the drag |
102 // (the race is that the dragend message arrives before the drop message so | 100 // (the race is that the dragend message arrives before the drop message so |
103 // the drop never takes place). | 101 // the drop never takes place). |
104 // crbug.com/233571 | 102 // crbug.com/233571 |
105 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; | 103 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; |
106 | 104 |
107 // Pointer to the guest that started the drag, used to forward necessary drag | 105 // Pointer to the guest that started the drag, used to forward necessary drag |
108 // status messages to the correct guest. | 106 // status messages to the correct guest. |
109 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 107 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
110 | 108 |
111 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 109 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
112 | 110 |
113 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 111 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
114 }; | 112 }; |
115 | 113 |
116 } // namespace content | 114 } // namespace content |
117 | 115 |
118 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 116 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |