| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void UpdateRectACK(int instance_id, int message_id, const gfx::Size& size); | 97 void UpdateRectACK(int instance_id, int message_id, const gfx::Size& size); |
| 98 void SetFocus(int instance_id, bool focused); | 98 void SetFocus(int instance_id, bool focused); |
| 99 // Handles input events sent from the BrowserPlugin (embedder's renderer | 99 // Handles input events sent from the BrowserPlugin (embedder's renderer |
| 100 // process) by passing them to appropriate guest's input handler. | 100 // process) by passing them to appropriate guest's input handler. |
| 101 void HandleInputEvent(int instance_id, | 101 void HandleInputEvent(int instance_id, |
| 102 RenderViewHost* render_view_host, | 102 RenderViewHost* render_view_host, |
| 103 const gfx::Rect& guest_rect, | 103 const gfx::Rect& guest_rect, |
| 104 const WebKit::WebInputEvent& event, | 104 const WebKit::WebInputEvent& event, |
| 105 IPC::Message* reply_message); | 105 IPC::Message* reply_message); |
| 106 void PluginDestroyed(int instance_id); | 106 void PluginDestroyed(int instance_id); |
| 107 // Called when the embedder posts a message to the guest. |
| 108 void RouteMessageEvent(int instance_id, |
| 109 const string16& data, |
| 110 int source_frame_id, |
| 111 const string16& target_origin, |
| 112 int target_frame_id); |
| 107 | 113 |
| 108 // Overrides factory for testing. Default (NULL) value indicates regular | 114 // Overrides factory for testing. Default (NULL) value indicates regular |
| 109 // (non-test) environment. | 115 // (non-test) environment. |
| 110 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { | 116 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { |
| 111 factory_ = factory; | 117 factory_ = factory; |
| 112 } | 118 } |
| 113 | 119 |
| 114 private: | 120 private: |
| 115 friend class TestBrowserPluginEmbedder; | 121 friend class TestBrowserPluginEmbedder; |
| 116 | 122 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 143 // Contains guests' WebContents, mapping from their instance ids. | 149 // Contains guests' WebContents, mapping from their instance ids. |
| 144 ContainerInstanceMap guest_web_contents_by_instance_id_; | 150 ContainerInstanceMap guest_web_contents_by_instance_id_; |
| 145 RenderViewHost* render_view_host_; | 151 RenderViewHost* render_view_host_; |
| 146 | 152 |
| 147 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 153 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
| 148 }; | 154 }; |
| 149 | 155 |
| 150 } // namespace content | 156 } // namespace content |
| 151 | 157 |
| 152 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 158 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
| OLD | NEW |