| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void CleanUp(); | 111 void CleanUp(); |
| 112 | 112 |
| 113 // Called when visiblity of web_contents changes, so the embedder will | 113 // Called when visiblity of web_contents changes, so the embedder will |
| 114 // show/hide its guest. | 114 // show/hide its guest. |
| 115 void WebContentsVisibilityChanged(bool visible); | 115 void WebContentsVisibilityChanged(bool visible); |
| 116 | 116 |
| 117 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); | 117 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); |
| 118 | 118 |
| 119 // Message handlers. | 119 // Message handlers. |
| 120 | 120 |
| 121 void OnAllocateInstanceID(int request_id); |
| 121 void OnCreateGuest(int instance_id, | 122 void OnCreateGuest(int instance_id, |
| 122 const BrowserPluginHostMsg_CreateGuest_Params& params); | 123 const BrowserPluginHostMsg_CreateGuest_Params& params); |
| 123 void OnPluginAtPositionResponse(int instance_id, | 124 void OnPluginAtPositionResponse(int instance_id, |
| 124 int request_id, | 125 int request_id, |
| 125 const gfx::Point& position); | 126 const gfx::Point& position); |
| 126 void OnPluginDestroyed(int instance_id); | 127 void OnPluginDestroyed(int instance_id); |
| 127 void OnSwapBuffersACK(int route_id, | 128 void OnSwapBuffersACK(int route_id, |
| 128 int gpu_host_id, | 129 int gpu_host_id, |
| 129 const std::string& mailbox_name, | 130 const std::string& mailbox_name, |
| 130 uint32 sync_point); | 131 uint32 sync_point); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 141 // Tracks the visibility state of the embedder. | 142 // Tracks the visibility state of the embedder. |
| 142 bool visible_; | 143 bool visible_; |
| 143 // Map that contains outstanding queries to |GetBrowserPluginAt|. | 144 // Map that contains outstanding queries to |GetBrowserPluginAt|. |
| 144 // We need a roundtrip to renderer process to know the answer, therefore | 145 // We need a roundtrip to renderer process to know the answer, therefore |
| 145 // storing these callbacks is required. | 146 // storing these callbacks is required. |
| 146 typedef std::map<int, WebContents::GetRenderViewHostCallback> | 147 typedef std::map<int, WebContents::GetRenderViewHostCallback> |
| 147 GetRenderViewHostCallbackMap; | 148 GetRenderViewHostCallbackMap; |
| 148 GetRenderViewHostCallbackMap pending_get_render_view_callbacks_; | 149 GetRenderViewHostCallbackMap pending_get_render_view_callbacks_; |
| 149 // Next request id for BrowserPluginMsg_PluginAtPositionRequest query. | 150 // Next request id for BrowserPluginMsg_PluginAtPositionRequest query. |
| 150 int next_get_render_view_request_id_; | 151 int next_get_render_view_request_id_; |
| 152 int instance_counter_; |
| 151 | 153 |
| 152 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 154 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
| 153 }; | 155 }; |
| 154 | 156 |
| 155 } // namespace content | 157 } // namespace content |
| 156 | 158 |
| 157 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 159 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
| OLD | NEW |