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 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" | 8 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" |
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 guest_renderer_prefs->browser_handles_all_top_level_requests = false; | 154 guest_renderer_prefs->browser_handles_all_top_level_requests = false; |
155 AddGuest(instance_id, guest_web_contents); | 155 AddGuest(instance_id, guest_web_contents); |
156 guest_web_contents->SetDelegate(guest); | 156 guest_web_contents->SetDelegate(guest); |
157 | 157 |
158 // Create a swapped out RenderView for the guest in the embedder render | 158 // Create a swapped out RenderView for the guest in the embedder render |
159 // process, so that the embedder can access the guest's window object. | 159 // process, so that the embedder can access the guest's window object. |
160 int guest_routing_id = | 160 int guest_routing_id = |
161 static_cast<WebContentsImpl*>(guest->GetWebContents())-> | 161 static_cast<WebContentsImpl*>(guest->GetWebContents())-> |
162 CreateSwappedOutRenderView(web_contents()->GetSiteInstance()); | 162 CreateSwappedOutRenderView(web_contents()->GetSiteInstance()); |
163 render_view_host->Send(new BrowserPluginMsg_GuestContentWindowReady( | 163 render_view_host->Send(new BrowserPluginMsg_GuestContentWindowReady( |
164 instance_id, guest_routing_id)); | 164 render_view_host->GetRoutingID(), instance_id, guest_routing_id)); |
165 } | 165 } |
166 | 166 |
167 void BrowserPluginEmbedder::NavigateGuest( | 167 void BrowserPluginEmbedder::NavigateGuest( |
168 RenderViewHost* render_view_host, | 168 RenderViewHost* render_view_host, |
169 int instance_id, | 169 int instance_id, |
170 const std::string& src, | 170 const std::string& src, |
171 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { | 171 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { |
172 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 172 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
173 CHECK(guest); | 173 CHECK(guest); |
174 GURL url(src); | 174 GURL url(src); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 bool visible = *Details<bool>(details).ptr(); | 369 bool visible = *Details<bool>(details).ptr(); |
370 WebContentsVisibilityChanged(visible); | 370 WebContentsVisibilityChanged(visible); |
371 break; | 371 break; |
372 } | 372 } |
373 default: | 373 default: |
374 NOTREACHED() << "Unexpected notification type: " << type; | 374 NOTREACHED() << "Unexpected notification type: " << type; |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
378 } // namespace content | 378 } // namespace content |
OLD | NEW |