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 #ifndef ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "android_webview/browser/aw_download_manager_delegate.h" | 10 #include "android_webview/browser/aw_download_manager_delegate.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } // namespace components | 25 } // namespace components |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 class ResourceContext; | 28 class ResourceContext; |
29 class WebContents; | 29 class WebContents; |
30 } // namespace content | 30 } // namespace content |
31 | 31 |
32 namespace android_webview { | 32 namespace android_webview { |
33 | 33 |
34 class AwURLRequestContextGetter; | 34 class AwURLRequestContextGetter; |
35 | 35 class AwQuotaManagerBridge; |
36 typedef content::GeolocationPermissionContext* GeolocationPermissionFactoryFn(); | 36 class JniDependencyFactory; |
37 | 37 |
38 class AwBrowserContext : public content::BrowserContext, | 38 class AwBrowserContext : public content::BrowserContext, |
39 public components::VisitedLinkDelegate { | 39 public components::VisitedLinkDelegate { |
40 public: | 40 public: |
41 | 41 |
42 AwBrowserContext( | 42 AwBrowserContext(const base::FilePath path, |
43 const base::FilePath path, | 43 JniDependencyFactory* native_factory); |
44 GeolocationPermissionFactoryFn* geolocation_permission_factory); | |
45 virtual ~AwBrowserContext(); | 44 virtual ~AwBrowserContext(); |
46 | 45 |
47 // Convenience method to returns the AwBrowserContext corresponding to the | 46 // Convenience method to returns the AwBrowserContext corresponding to the |
48 // given WebContents. | 47 // given WebContents. |
49 static AwBrowserContext* FromWebContents( | 48 static AwBrowserContext* FromWebContents( |
50 content::WebContents* web_contents); | 49 content::WebContents* web_contents); |
51 | 50 |
52 // Called before BrowserThreads are created. | 51 // Called before BrowserThreads are created. |
53 void InitializeBeforeThreadCreation(); | 52 void InitializeBeforeThreadCreation(); |
54 | 53 |
(...skipping 21 matching lines...) Expand all Loading... |
76 blob_protocol_handler, | 75 blob_protocol_handler, |
77 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 76 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
78 file_system_protocol_handler, | 77 file_system_protocol_handler, |
79 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 78 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
80 developer_protocol_handler, | 79 developer_protocol_handler, |
81 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 80 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
82 chrome_protocol_handler, | 81 chrome_protocol_handler, |
83 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 82 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
84 chrome_devtools_protocol_handler); | 83 chrome_devtools_protocol_handler); |
85 | 84 |
| 85 AwQuotaManagerBridge* GetQuotaManagerBridge(); |
| 86 |
86 // content::BrowserContext implementation. | 87 // content::BrowserContext implementation. |
87 virtual base::FilePath GetPath() OVERRIDE; | 88 virtual base::FilePath GetPath() OVERRIDE; |
88 virtual bool IsOffTheRecord() const OVERRIDE; | 89 virtual bool IsOffTheRecord() const OVERRIDE; |
89 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 90 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
90 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 91 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
91 int renderer_child_id) OVERRIDE; | 92 int renderer_child_id) OVERRIDE; |
92 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; | 93 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; |
93 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 94 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
94 int renderer_child_id) OVERRIDE; | 95 int renderer_child_id) OVERRIDE; |
95 virtual net::URLRequestContextGetter* | 96 virtual net::URLRequestContextGetter* |
96 GetMediaRequestContextForStoragePartition( | 97 GetMediaRequestContextForStoragePartition( |
97 const base::FilePath& partition_path, bool in_memory) OVERRIDE; | 98 const base::FilePath& partition_path, bool in_memory) OVERRIDE; |
98 virtual content::ResourceContext* GetResourceContext() OVERRIDE; | 99 virtual content::ResourceContext* GetResourceContext() OVERRIDE; |
99 virtual content::DownloadManagerDelegate* | 100 virtual content::DownloadManagerDelegate* |
100 GetDownloadManagerDelegate() OVERRIDE; | 101 GetDownloadManagerDelegate() OVERRIDE; |
101 virtual content::GeolocationPermissionContext* | 102 virtual content::GeolocationPermissionContext* |
102 GetGeolocationPermissionContext() OVERRIDE; | 103 GetGeolocationPermissionContext() OVERRIDE; |
103 virtual content::SpeechRecognitionPreferences* | 104 virtual content::SpeechRecognitionPreferences* |
104 GetSpeechRecognitionPreferences() OVERRIDE; | 105 GetSpeechRecognitionPreferences() OVERRIDE; |
105 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 106 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
106 | 107 |
107 // components::VisitedLinkDelegate implementation. | 108 // components::VisitedLinkDelegate implementation. |
108 virtual void RebuildTable( | 109 virtual void RebuildTable( |
109 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; | 110 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; |
110 | 111 |
111 private: | 112 private: |
112 // The file path where data for this context is persisted. | 113 // The file path where data for this context is persisted. |
113 base::FilePath context_storage_path_; | 114 base::FilePath context_storage_path_; |
114 | 115 |
| 116 JniDependencyFactory* native_factory_; |
115 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; | 117 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; |
116 GeolocationPermissionFactoryFn* geolocation_permission_factory_; | |
117 scoped_refptr<content::GeolocationPermissionContext> | 118 scoped_refptr<content::GeolocationPermissionContext> |
118 geolocation_permission_context_; | 119 geolocation_permission_context_; |
| 120 scoped_ptr<AwQuotaManagerBridge> quota_manager_bridge_; |
119 | 121 |
120 AwDownloadManagerDelegate download_manager_delegate_; | 122 AwDownloadManagerDelegate download_manager_delegate_; |
121 | 123 |
122 scoped_ptr<components::VisitedLinkMaster> visitedlink_master_; | 124 scoped_ptr<components::VisitedLinkMaster> visitedlink_master_; |
123 scoped_ptr<content::ResourceContext> resource_context_; | 125 scoped_ptr<content::ResourceContext> resource_context_; |
124 | 126 |
125 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); | 127 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); |
126 }; | 128 }; |
127 | 129 |
128 } // namespace android_webview | 130 } // namespace android_webview |
129 | 131 |
130 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 132 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
OLD | NEW |