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