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 has a list of guest it manages. | 5 // A BrowserPluginEmbedder has a list of guest it manages. |
6 // In the beginning when a renderer sees one or more guests (BrowserPlugin | 6 // In the beginning when a renderer sees one or more guests (BrowserPlugin |
7 // instance(s)) and there is a request to navigate to them, the WebContents for | 7 // instance(s)) and there is a request to navigate to them, the WebContents for |
8 // that renderer creates a BrowserPluginEmbedder for itself. The | 8 // that renderer creates a BrowserPluginEmbedder for itself. The |
9 // BrowserPluginEmbedder, in turn, manages a set of BrowserPluginGuests -- one | 9 // BrowserPluginEmbedder, in turn, manages a set of BrowserPluginGuests -- one |
10 // BrowserPluginGuest for each guest in the embedding WebContents. | 10 // BrowserPluginGuest for each guest in the embedding WebContents. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 bool resize_pending, | 128 bool resize_pending, |
129 float scale_factor); | 129 float scale_factor); |
130 // Handles input events sent from the BrowserPlugin (embedder's renderer | 130 // Handles input events sent from the BrowserPlugin (embedder's renderer |
131 // process) by passing them to appropriate guest's input handler. | 131 // process) by passing them to appropriate guest's input handler. |
132 void HandleInputEvent(int instance_id, | 132 void HandleInputEvent(int instance_id, |
133 RenderViewHost* render_view_host, | 133 RenderViewHost* render_view_host, |
134 const gfx::Rect& guest_rect, | 134 const gfx::Rect& guest_rect, |
135 const WebKit::WebInputEvent& event, | 135 const WebKit::WebInputEvent& event, |
136 IPC::Message* reply_message); | 136 IPC::Message* reply_message); |
137 void PluginDestroyed(int instance_id); | 137 void PluginDestroyed(int instance_id); |
| 138 void Stop(int instance_id); |
| 139 void Reload(int instance_id); |
138 | 140 |
139 // Called when visiblity of web_contents changes, so the embedder will | 141 // Called when visiblity of web_contents changes, so the embedder will |
140 // show/hide its guest. | 142 // show/hide its guest. |
141 void WebContentsVisibilityChanged(bool visible); | 143 void WebContentsVisibilityChanged(bool visible); |
142 | 144 |
143 // Static factory instance (always NULL for non-test). | 145 // Static factory instance (always NULL for non-test). |
144 static BrowserPluginHostFactory* factory_; | 146 static BrowserPluginHostFactory* factory_; |
145 | 147 |
146 // A scoped container for notification registries. | 148 // A scoped container for notification registries. |
147 NotificationRegistrar registrar_; | 149 NotificationRegistrar registrar_; |
148 | 150 |
149 // Contains guests' WebContents, mapping to their frame ids. | 151 // Contains guests' WebContents, mapping to their frame ids. |
150 GuestWebContentsMap guest_web_contents_container_; | 152 GuestWebContentsMap guest_web_contents_container_; |
151 // Contains guests' WebContents, mapping from their instance ids. | 153 // Contains guests' WebContents, mapping from their instance ids. |
152 ContainerInstanceMap guest_web_contents_by_instance_id_; | 154 ContainerInstanceMap guest_web_contents_by_instance_id_; |
153 RenderViewHost* render_view_host_; | 155 RenderViewHost* render_view_host_; |
154 | 156 |
155 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 157 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
156 }; | 158 }; |
157 | 159 |
158 } // namespace content | 160 } // namespace content |
159 | 161 |
160 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 162 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |