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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_LIB_BROWSER_DELEGATE_IMPL_H_
6 #define ANDROID_WEBVIEW_LIB_BROWSER_DELEGATE_IMPL_H_
8 #include "android_webview/native/aw_browser_dependency_factory.h"
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
14 class URLRequestContextGetter
;
17 namespace android_webview
{
19 class AwNetworkDelegate
;
21 class AwBrowserDependencyFactoryImpl
: public AwBrowserDependencyFactory
{
23 AwBrowserDependencyFactoryImpl();
24 virtual ~AwBrowserDependencyFactoryImpl();
26 // Sets this class as the singleton instance.
27 static void InstallInstance();
29 // AwBrowserDependencyFactory
30 virtual content::BrowserContext
* GetBrowserContext(bool incognito
) OVERRIDE
;
31 virtual content::WebContents
* CreateWebContents(bool incognito
) OVERRIDE
;
32 virtual AwContentsContainer
* CreateContentsContainer(
33 content::WebContents
* contents
) OVERRIDE
;
34 virtual content::JavaScriptDialogCreator
* GetJavaScriptDialogCreator()
38 void InitializeNetworkDelegateOnIOThread(
39 net::URLRequestContextGetter
* normal_context
,
40 net::URLRequestContextGetter
* incognito_context
);
41 void EnsureNetworkDelegateInitialized();
43 // Constructed and assigned on the IO thread.
44 scoped_ptr
<AwNetworkDelegate
> network_delegate_
;
45 // Set on the UI thread.
46 bool initialized_network_delegate_
;
48 DISALLOW_COPY_AND_ASSIGN(AwBrowserDependencyFactoryImpl
);
51 } // namespace android_webview
53 #endif // ANDROID_WEBVIEW_LIB_BROWSER_DELEGATE_IMPL_H_