| 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/old/browser_plugin_host.h" | 5 #include "content/browser/browser_plugin/old/browser_plugin_host.h" |
| 6 | 6 |
| 7 #include "content/browser/browser_plugin/old/browser_plugin_host_helper.h" | 7 #include "content/browser/browser_plugin/old/browser_plugin_host_helper.h" |
| 8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/common/old_browser_plugin_messages.h" | 10 #include "content/common/old_browser_plugin_messages.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 std::string host = render_view_host->GetSiteInstance()->GetSite().host(); | 87 std::string host = render_view_host->GetSiteInstance()->GetSite().host(); |
| 88 GURL guest_url( | 88 GURL guest_url( |
| 89 base::StringPrintf("%s://%s", chrome::kGuestScheme, host.c_str())); | 89 base::StringPrintf("%s://%s", chrome::kGuestScheme, host.c_str())); |
| 90 // The SiteInstance of a given guest is based on the fact that it's a guest | 90 // The SiteInstance of a given guest is based on the fact that it's a guest |
| 91 // in addition to which platform application the guest belongs to, rather | 91 // in addition to which platform application the guest belongs to, rather |
| 92 // than the URL that the guest is being navigated to. | 92 // than the URL that the guest is being navigated to. |
| 93 SiteInstance* guest_site_instance = | 93 SiteInstance* guest_site_instance = |
| 94 SiteInstance::CreateForURL(web_contents()->GetBrowserContext(), | 94 SiteInstance::CreateForURL(web_contents()->GetBrowserContext(), |
| 95 guest_url); | 95 guest_url); |
| 96 guest_web_contents = | 96 guest_web_contents = |
| 97 static_cast<WebContentsImpl*>( | 97 WebContentsImpl::Create( |
| 98 WebContents::Create( | 98 web_contents()->GetBrowserContext(), |
| 99 web_contents()->GetBrowserContext(), | 99 guest_site_instance, |
| 100 guest_site_instance, | 100 MSG_ROUTING_NONE, |
| 101 MSG_ROUTING_NONE, | 101 NULL // base WebContents |
| 102 NULL, // base WebContents | 102 ); |
| 103 NULL // session storage namespace | |
| 104 )); | |
| 105 guest_observer = | 103 guest_observer = |
| 106 guest_web_contents->browser_plugin_host(); | 104 guest_web_contents->browser_plugin_host(); |
| 107 guest_observer->set_embedder_render_process_host( | 105 guest_observer->set_embedder_render_process_host( |
| 108 render_view_host->GetProcess()); | 106 render_view_host->GetProcess()); |
| 109 guest_observer->set_instance_id(container_instance_id); | 107 guest_observer->set_instance_id(container_instance_id); |
| 110 RegisterContainerInstance(container_instance_id, guest_observer); | 108 RegisterContainerInstance(container_instance_id, guest_observer); |
| 111 AddGuest(guest_web_contents, frame_id); | 109 AddGuest(guest_web_contents, frame_id); |
| 112 } | 110 } |
| 113 guest_observer->web_contents()->SetDelegate(guest_observer); | 111 guest_observer->web_contents()->SetDelegate(guest_observer); |
| 114 guest_observer->web_contents()->GetController().LoadURL( | 112 guest_observer->web_contents()->GetController().LoadURL( |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 web_contents->WasHidden(); | 226 web_contents->WasHidden(); |
| 229 } | 227 } |
| 230 break; | 228 break; |
| 231 } | 229 } |
| 232 default: | 230 default: |
| 233 NOTREACHED() << "Unexpected notification type: " << type; | 231 NOTREACHED() << "Unexpected notification type: " << type; |
| 234 } | 232 } |
| 235 } | 233 } |
| 236 | 234 |
| 237 } // namespace content | 235 } // namespace content |
| OLD | NEW |