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