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 guests it manages. | 5 // A BrowserPluginEmbedder has a list of guests 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. Note that | 10 // BrowserPluginGuest for each guest in the embedding WebContents. Note that |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 bool resize_pending, | 114 bool resize_pending, |
115 float scale_factor); | 115 float scale_factor); |
116 // Handles input events sent from the BrowserPlugin (embedder's renderer | 116 // Handles input events sent from the BrowserPlugin (embedder's renderer |
117 // process) by passing them to appropriate guest's input handler. | 117 // process) by passing them to appropriate guest's input handler. |
118 void HandleInputEvent(int instance_id, | 118 void HandleInputEvent(int instance_id, |
119 RenderViewHost* render_view_host, | 119 RenderViewHost* render_view_host, |
120 const gfx::Rect& guest_rect, | 120 const gfx::Rect& guest_rect, |
121 const WebKit::WebInputEvent& event, | 121 const WebKit::WebInputEvent& event, |
122 IPC::Message* reply_message); | 122 IPC::Message* reply_message); |
123 void PluginDestroyed(int instance_id); | 123 void PluginDestroyed(int instance_id); |
| 124 void Back(int instance_id); |
| 125 void Forward(int instance_id); |
| 126 void Go(int instance_id, int relative_index); |
124 | 127 |
125 // Called when visiblity of web_contents changes, so the embedder will | 128 // Called when visiblity of web_contents changes, so the embedder will |
126 // show/hide its guest. | 129 // show/hide its guest. |
127 void WebContentsVisibilityChanged(bool visible); | 130 void WebContentsVisibilityChanged(bool visible); |
128 | 131 |
129 // Static factory instance (always NULL for non-test). | 132 // Static factory instance (always NULL for non-test). |
130 static BrowserPluginHostFactory* factory_; | 133 static BrowserPluginHostFactory* factory_; |
131 | 134 |
132 // A scoped container for notification registries. | 135 // A scoped container for notification registries. |
133 NotificationRegistrar registrar_; | 136 NotificationRegistrar registrar_; |
134 | 137 |
135 // Contains guests' WebContents, mapping from their instance ids. | 138 // Contains guests' WebContents, mapping from their instance ids. |
136 ContainerInstanceMap guest_web_contents_by_instance_id_; | 139 ContainerInstanceMap guest_web_contents_by_instance_id_; |
137 RenderViewHost* render_view_host_; | 140 RenderViewHost* render_view_host_; |
138 | 141 |
139 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 142 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
140 }; | 143 }; |
141 | 144 |
142 } // namespace content | 145 } // namespace content |
143 | 146 |
144 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 147 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |