| Index: ui/views/controls/webview/webview.cc
|
| diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
|
| index eb7846ba6c99d39d147be11fb74e3b1bcd6e3540..b6825d15159fd13b09e8efd6a2787289baede75a 100644
|
| --- a/ui/views/controls/webview/webview.cc
|
| +++ b/ui/views/controls/webview/webview.cc
|
| @@ -17,6 +17,7 @@
|
| #include "ui/base/accessibility/accessibility_types.h"
|
| #include "ui/views/controls/native/native_view_host.h"
|
| #include "ui/views/focus/focus_manager.h"
|
| +#include "ui/views/views_delegate.h"
|
|
|
| namespace views {
|
|
|
| @@ -46,11 +47,7 @@ content::WebContents* WebView::GetWebContents() {
|
| void WebView::CreateWebContentsWithSiteInstance(
|
| content::SiteInstance* site_instance) {
|
| if (!web_contents_) {
|
| - wc_owner_.reset(content::WebContents::Create(browser_context_,
|
| - site_instance,
|
| - MSG_ROUTING_NONE,
|
| - NULL,
|
| - NULL));
|
| + wc_owner_.reset(CreateWebContents(browser_context_, site_instance));
|
| web_contents_ = wc_owner_.get();
|
| web_contents_->SetDelegate(this);
|
| AttachWebContents();
|
| @@ -228,4 +225,24 @@ void WebView::WebContentsDestroyed(content::WebContents* web_contents) {
|
| SetWebContents(NULL);
|
| }
|
|
|
| +content::WebContents* WebView::CreateWebContents(
|
| + content::BrowserContext* browser_context,
|
| + content::SiteInstance* site_instance) {
|
| + content::WebContents* contents = NULL;
|
| + if (ViewsDelegate::views_delegate) {
|
| + contents = ViewsDelegate::views_delegate->CreateWebContents(
|
| + browser_context, site_instance);
|
| + }
|
| +
|
| + if (!contents) {
|
| + return content::WebContents::Create(browser_context,
|
| + site_instance,
|
| + MSG_ROUTING_NONE,
|
| + NULL,
|
| + NULL);
|
| + }
|
| +
|
| + return contents;
|
| +}
|
| +
|
| } // namespace views
|
|
|