| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void UpdateRectACK(int instance_id, int message_id, const gfx::Size& size); | 98 void UpdateRectACK(int instance_id, int message_id, const gfx::Size& size); |
| 99 void SetFocus(int instance_id, bool focused); | 99 void SetFocus(int instance_id, bool focused); |
| 100 // Handles input events sent from the BrowserPlugin (embedder's renderer | 100 // Handles input events sent from the BrowserPlugin (embedder's renderer |
| 101 // process) by passing them to appropriate guest's input handler. | 101 // process) by passing them to appropriate guest's input handler. |
| 102 void HandleInputEvent(int instance_id, | 102 void HandleInputEvent(int instance_id, |
| 103 RenderViewHost* render_view_host, | 103 RenderViewHost* render_view_host, |
| 104 const gfx::Rect& guest_rect, | 104 const gfx::Rect& guest_rect, |
| 105 const WebKit::WebInputEvent& event, | 105 const WebKit::WebInputEvent& event, |
| 106 IPC::Message* reply_message); | 106 IPC::Message* reply_message); |
| 107 void PluginDestroyed(int instance_id); | 107 void PluginDestroyed(int instance_id); |
| 108 void SetGuestVisibility(int instance_id, |
| 109 bool guest_visible); |
| 108 | 110 |
| 109 // Overrides factory for testing. Default (NULL) value indicates regular | 111 // Overrides factory for testing. Default (NULL) value indicates regular |
| 110 // (non-test) environment. | 112 // (non-test) environment. |
| 111 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { | 113 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { |
| 112 factory_ = factory; | 114 factory_ = factory; |
| 113 } | 115 } |
| 114 | 116 |
| 115 private: | 117 private: |
| 116 friend class TestBrowserPluginEmbedder; | 118 friend class TestBrowserPluginEmbedder; |
| 117 | 119 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 137 | 139 |
| 138 // Static factory instance (always NULL for non-test). | 140 // Static factory instance (always NULL for non-test). |
| 139 static BrowserPluginHostFactory* factory_; | 141 static BrowserPluginHostFactory* factory_; |
| 140 | 142 |
| 141 // A scoped container for notification registries. | 143 // A scoped container for notification registries. |
| 142 NotificationRegistrar registrar_; | 144 NotificationRegistrar registrar_; |
| 143 | 145 |
| 144 // Contains guests' WebContents, mapping from their instance ids. | 146 // Contains guests' WebContents, mapping from their instance ids. |
| 145 ContainerInstanceMap guest_web_contents_by_instance_id_; | 147 ContainerInstanceMap guest_web_contents_by_instance_id_; |
| 146 RenderViewHost* render_view_host_; | 148 RenderViewHost* render_view_host_; |
| 149 bool visible_; |
| 147 | 150 |
| 148 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 151 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 } // namespace content | 154 } // namespace content |
| 152 | 155 |
| 153 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 156 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
| OLD | NEW |