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 22 matching lines...) Expand all Loading... |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
34 #include "ui/surface/transport_dib.h" | 34 #include "ui/surface/transport_dib.h" |
35 #include "webkit/glue/webcursor.h" | 35 #include "webkit/glue/webcursor.h" |
36 | 36 |
37 namespace gfx { | 37 namespace gfx { |
38 class Size; | 38 class Size; |
39 } | 39 } |
40 | 40 |
41 class WebContentsImpl; | 41 class WebContentsImpl; |
42 | 42 |
| 43 struct BrowserPluginHostMsg_PostMessage_Params; |
43 struct BrowserPluginHostMsg_ResizeGuest_Params; | 44 struct BrowserPluginHostMsg_ResizeGuest_Params; |
44 struct ViewHostMsg_UpdateRect_Params; | 45 struct ViewHostMsg_UpdateRect_Params; |
45 | 46 |
46 namespace content { | 47 namespace content { |
47 | 48 |
48 class BrowserPluginGuest; | 49 class BrowserPluginGuest; |
49 class BrowserPluginHostFactory; | 50 class BrowserPluginHostFactory; |
50 | 51 |
51 // A browser plugin embedder provides functionality for WebContents to operate | 52 // A browser plugin embedder provides functionality for WebContents to operate |
52 // in the 'embedder' role. It manages list of guests inside the embedder. | 53 // in the 'embedder' role. It manages list of guests inside the embedder. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 bool resize_pending, | 129 bool resize_pending, |
129 float scale_factor); | 130 float scale_factor); |
130 // Handles input events sent from the BrowserPlugin (embedder's renderer | 131 // Handles input events sent from the BrowserPlugin (embedder's renderer |
131 // process) by passing them to appropriate guest's input handler. | 132 // process) by passing them to appropriate guest's input handler. |
132 void HandleInputEvent(int instance_id, | 133 void HandleInputEvent(int instance_id, |
133 RenderViewHost* render_view_host, | 134 RenderViewHost* render_view_host, |
134 const gfx::Rect& guest_rect, | 135 const gfx::Rect& guest_rect, |
135 const WebKit::WebInputEvent& event, | 136 const WebKit::WebInputEvent& event, |
136 IPC::Message* reply_message); | 137 IPC::Message* reply_message); |
137 void PluginDestroyed(int instance_id); | 138 void PluginDestroyed(int instance_id); |
| 139 // Called when the embedder posts a message to the guest. |
| 140 void RouteMessageEvent(int instance_id, |
| 141 const string16& data, |
| 142 const string16& target_origin); |
138 | 143 |
139 // Called when visiblity of web_contents changes, so the embedder will | 144 // Called when visiblity of web_contents changes, so the embedder will |
140 // show/hide its guest. | 145 // show/hide its guest. |
141 void WebContentsVisibilityChanged(bool visible); | 146 void WebContentsVisibilityChanged(bool visible); |
142 | 147 |
143 // Static factory instance (always NULL for non-test). | 148 // Static factory instance (always NULL for non-test). |
144 static BrowserPluginHostFactory* factory_; | 149 static BrowserPluginHostFactory* factory_; |
145 | 150 |
146 // A scoped container for notification registries. | 151 // A scoped container for notification registries. |
147 NotificationRegistrar registrar_; | 152 NotificationRegistrar registrar_; |
148 | 153 |
149 // Contains guests' WebContents, mapping to their frame ids. | 154 // Contains guests' WebContents, mapping to their frame ids. |
150 GuestWebContentsMap guest_web_contents_container_; | 155 GuestWebContentsMap guest_web_contents_container_; |
151 // Contains guests' WebContents, mapping from their instance ids. | 156 // Contains guests' WebContents, mapping from their instance ids. |
152 ContainerInstanceMap guest_web_contents_by_instance_id_; | 157 ContainerInstanceMap guest_web_contents_by_instance_id_; |
153 RenderViewHost* render_view_host_; | 158 RenderViewHost* render_view_host_; |
154 | 159 |
155 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 160 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
156 }; | 161 }; |
157 | 162 |
158 } // namespace content | 163 } // namespace content |
159 | 164 |
160 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 165 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |