| 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 WebContentsImpl* new_contents = new WebContentsImpl( | 383 WebContentsImpl* new_contents = new WebContentsImpl( |
| 384 params.browser_context, opener); | 384 params.browser_context, opener); |
| 385 | 385 |
| 386 new_contents->Init(params); | 386 new_contents->Init(params); |
| 387 return new_contents; | 387 return new_contents; |
| 388 } | 388 } |
| 389 | 389 |
| 390 WebContentsImpl* WebContentsImpl::CreateGuest( | 390 WebContentsImpl* WebContentsImpl::CreateGuest( |
| 391 BrowserContext* browser_context, | 391 BrowserContext* browser_context, |
| 392 SiteInstance* site_instance, | 392 SiteInstance* site_instance, |
| 393 int routing_id, |
| 394 WebContentsImpl* base_web_contents, |
| 393 int guest_instance_id, | 395 int guest_instance_id, |
| 394 const BrowserPluginHostMsg_CreateGuest_Params& params) { | 396 const BrowserPluginHostMsg_CreateGuest_Params& params) { |
| 395 | 397 |
| 396 WebContentsImpl* new_contents = new WebContentsImpl(browser_context, NULL); | 398 WebContentsImpl* new_contents = new WebContentsImpl(browser_context, |
| 399 base_web_contents); |
| 397 | 400 |
| 398 // This makes |new_contents| act as a guest. | 401 // This makes |new_contents| act as a guest. |
| 399 // For more info, see comment above class BrowserPluginGuest. | 402 // For more info, see comment above class BrowserPluginGuest. |
| 400 new_contents->browser_plugin_guest_.reset( | 403 new_contents->browser_plugin_guest_.reset( |
| 401 BrowserPluginGuest::Create( | 404 BrowserPluginGuest::Create( |
| 402 guest_instance_id, | 405 guest_instance_id, |
| 403 new_contents, | 406 new_contents, |
| 404 params)); | 407 params)); |
| 405 | 408 |
| 406 new_contents->Init(WebContents::CreateParams(browser_context, site_instance)); | 409 WebContents::CreateParams create_params(browser_context, site_instance); |
| 410 create_params.routing_id = routing_id; |
| 411 new_contents->Init(create_params); |
| 407 | 412 |
| 408 return new_contents; | 413 return new_contents; |
| 409 } | 414 } |
| 410 | 415 |
| 411 WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, | 416 WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, |
| 412 const GURL& url) { | 417 const GURL& url) { |
| 413 WebPreferences prefs; | 418 WebPreferences prefs; |
| 414 | 419 |
| 415 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 420 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 416 | 421 |
| (...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3382 | 3387 |
| 3383 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3388 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
| 3384 return browser_plugin_guest_.get(); | 3389 return browser_plugin_guest_.get(); |
| 3385 } | 3390 } |
| 3386 | 3391 |
| 3387 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3392 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
| 3388 return browser_plugin_embedder_.get(); | 3393 return browser_plugin_embedder_.get(); |
| 3389 } | 3394 } |
| 3390 | 3395 |
| 3391 } // namespace content | 3396 } // namespace content |
| OLD | NEW |