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" |
11 #include "base/basictypes.h" | |
12 #include "base/compiler_specific.h" | |
11 #include "base/file_path.h" | 13 #include "base/file_path.h" |
12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | |
13 #include "components/visitedlink/browser/visitedlink_delegate.h" | 16 #include "components/visitedlink/browser/visitedlink_delegate.h" |
14 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
15 #include "content/public/browser/geolocation_permission_context.h" | 18 #include "content/public/browser/geolocation_permission_context.h" |
19 #include "net/url_request/url_request_job_factory.h" | |
16 | 20 |
17 class GURL; | 21 class GURL; |
18 | 22 |
19 namespace components { | 23 namespace components { |
20 class VisitedLinkMaster; | 24 class VisitedLinkMaster; |
21 } // namespace components | 25 } // namespace components |
22 | 26 |
23 namespace content { | 27 namespace content { |
28 class ResourceContext; | |
24 class WebContents; | 29 class WebContents; |
25 } // namespace content | 30 } // namespace content |
26 | 31 |
27 namespace android_webview { | 32 namespace android_webview { |
28 | 33 |
29 class AwURLRequestContextGetter; | 34 class AwURLRequestContextGetter; |
30 | 35 |
31 typedef content::GeolocationPermissionContext* GeolocationPermissionFactoryFn(); | 36 typedef content::GeolocationPermissionContext* GeolocationPermissionFactoryFn(); |
32 | 37 |
33 class AwBrowserContext : public content::BrowserContext, | 38 class AwBrowserContext : public content::BrowserContext, |
(...skipping 18 matching lines...) Expand all Loading... | |
52 | 57 |
53 // These methods map to Add methods in components::VisitedLinkMaster. | 58 // These methods map to Add methods in components::VisitedLinkMaster. |
54 void AddVisitedURLs(const std::vector<GURL>& urls); | 59 void AddVisitedURLs(const std::vector<GURL>& urls); |
55 | 60 |
56 // content::BrowserContext implementation. | 61 // content::BrowserContext implementation. |
57 virtual FilePath GetPath() OVERRIDE; | 62 virtual FilePath GetPath() OVERRIDE; |
58 virtual bool IsOffTheRecord() const OVERRIDE; | 63 virtual bool IsOffTheRecord() const OVERRIDE; |
59 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 64 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
60 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 65 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
61 int renderer_child_id) OVERRIDE; | 66 int renderer_child_id) OVERRIDE; |
62 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | |
63 const FilePath& partition_path, bool in_memory) OVERRIDE; | |
64 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; | 67 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; |
65 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 68 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
66 int renderer_child_id) OVERRIDE; | 69 int renderer_child_id) OVERRIDE; |
67 virtual net::URLRequestContextGetter* | 70 virtual net::URLRequestContextGetter* |
68 GetMediaRequestContextForStoragePartition( | 71 GetMediaRequestContextForStoragePartition( |
69 const FilePath& partition_path, bool in_memory) OVERRIDE; | 72 const FilePath& partition_path, bool in_memory) OVERRIDE; |
70 virtual content::ResourceContext* GetResourceContext() OVERRIDE; | 73 virtual content::ResourceContext* GetResourceContext() OVERRIDE; |
71 virtual content::DownloadManagerDelegate* | 74 virtual content::DownloadManagerDelegate* |
72 GetDownloadManagerDelegate() OVERRIDE; | 75 GetDownloadManagerDelegate() OVERRIDE; |
73 virtual content::GeolocationPermissionContext* | 76 virtual content::GeolocationPermissionContext* |
74 GetGeolocationPermissionContext() OVERRIDE; | 77 GetGeolocationPermissionContext() OVERRIDE; |
75 virtual content::SpeechRecognitionPreferences* | 78 virtual content::SpeechRecognitionPreferences* |
76 GetSpeechRecognitionPreferences() OVERRIDE; | 79 GetSpeechRecognitionPreferences() OVERRIDE; |
77 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 80 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
78 | 81 |
79 // components::VisitedLinkDelegate implementation. | 82 // components::VisitedLinkDelegate implementation. |
80 virtual void RebuildTable( | 83 virtual void RebuildTable( |
81 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; | 84 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; |
82 | 85 |
86 net::URLRequestContextGetter* CreateRequestContext( | |
joth
2013/02/07 00:41:41
nit: we currently have all non-virtual (non-overri
pauljensen
2013/02/07 14:10:54
Done.
| |
87 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
88 blob_protocol_handler, | |
89 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
90 file_system_protocol_handler, | |
91 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
92 developer_protocol_handler, | |
93 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
94 chrome_protocol_handler, | |
95 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
96 chrome_devtools_protocol_handler); | |
joth
2013/02/07 00:41:41
seems a list of 5 params of same type would be eas
awong
2013/02/07 00:44:38
A struct is possible, but the long term plan (read
| |
97 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | |
98 const FilePath& partition_path, | |
99 bool in_memory, | |
100 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
101 blob_protocol_handler, | |
102 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
103 file_system_protocol_handler, | |
104 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
105 developer_protocol_handler, | |
106 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
107 chrome_protocol_handler, | |
108 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
109 chrome_devtools_protocol_handler); | |
110 | |
83 private: | 111 private: |
84 | |
85 // The file path where data for this context is persisted. | 112 // The file path where data for this context is persisted. |
86 FilePath context_storage_path_; | 113 FilePath context_storage_path_; |
87 | 114 |
88 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; | 115 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; |
89 GeolocationPermissionFactoryFn* geolocation_permission_factory_; | 116 GeolocationPermissionFactoryFn* geolocation_permission_factory_; |
90 scoped_refptr<content::GeolocationPermissionContext> | 117 scoped_refptr<content::GeolocationPermissionContext> |
91 geolocation_permission_context_; | 118 geolocation_permission_context_; |
92 | 119 |
93 AwDownloadManagerDelegate download_manager_delegate_; | 120 AwDownloadManagerDelegate download_manager_delegate_; |
94 | 121 |
95 scoped_ptr<components::VisitedLinkMaster> visitedlink_master_; | 122 scoped_ptr<components::VisitedLinkMaster> visitedlink_master_; |
123 scoped_ptr<content::ResourceContext> resource_context_; | |
96 | 124 |
97 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); | 125 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); |
98 }; | 126 }; |
99 | 127 |
100 } // namespace android_webview | 128 } // namespace android_webview |
101 | 129 |
102 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 130 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
OLD | NEW |