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 "android_webview/lib/aw_browser_dependency_factory_impl.h" | 5 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_content_browser_client.h" | 8 #include "android_webview/browser/aw_content_browser_client.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "content/public/browser/content_browser_client.h" | 10 #include "content/public/browser/content_browser_client.h" |
11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
12 #include "content/public/browser/web_contents_source.h" | |
12 #include "content/public/common/content_client.h" | 13 #include "content/public/common/content_client.h" |
13 | 14 |
14 using content::BrowserContext; | 15 using content::BrowserContext; |
15 using content::WebContents; | 16 using content::WebContents; |
16 | 17 |
17 namespace android_webview { | 18 namespace android_webview { |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 base::LazyInstance<AwBrowserDependencyFactoryImpl>::Leaky g_lazy_instance; | 22 base::LazyInstance<AwBrowserDependencyFactoryImpl>::Leaky g_lazy_instance; |
22 | 23 |
23 } // namespace | 24 } // namespace |
24 | 25 |
25 AwBrowserDependencyFactoryImpl::AwBrowserDependencyFactoryImpl() {} | 26 AwBrowserDependencyFactoryImpl::AwBrowserDependencyFactoryImpl() {} |
26 | 27 |
27 AwBrowserDependencyFactoryImpl::~AwBrowserDependencyFactoryImpl() {} | 28 AwBrowserDependencyFactoryImpl::~AwBrowserDependencyFactoryImpl() {} |
28 | 29 |
29 // static | 30 // static |
30 void AwBrowserDependencyFactoryImpl::InstallInstance() { | 31 void AwBrowserDependencyFactoryImpl::InstallInstance() { |
31 SetInstance(g_lazy_instance.Pointer()); | 32 SetInstance(g_lazy_instance.Pointer()); |
32 } | 33 } |
33 | 34 |
34 content::BrowserContext* AwBrowserDependencyFactoryImpl::GetBrowserContext() { | 35 content::BrowserContext* AwBrowserDependencyFactoryImpl::GetBrowserContext() { |
35 return AwContentBrowserClient::GetAwBrowserContext(); | 36 return AwContentBrowserClient::GetAwBrowserContext(); |
36 } | 37 } |
37 | 38 |
38 WebContents* AwBrowserDependencyFactoryImpl::CreateWebContents() { | 39 WebContents* AwBrowserDependencyFactoryImpl::CreateWebContents() { |
39 return content::WebContents::Create( | 40 content::WebContents* web_contents = content::WebContents::Create( |
40 content::WebContents::CreateParams(GetBrowserContext())); | 41 content::WebContents::CreateParams(GetBrowserContext())); |
42 WebContentsSource::CreateForWebContentsAndLocation(web_contents, FROM_HERE); | |
Mike Wittman
2015/11/11 17:15:28
Web contents modal dialogs aren't supported on And
hcarmona
2015/11/11 19:57:57
Done.
| |
43 return web_contents; | |
41 } | 44 } |
42 | 45 |
43 } // namespace android_webview | 46 } // namespace android_webview |
OLD | NEW |