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