| 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 { |
| 24 class WebContents; | 28 class WebContents; |
| 25 } // namespace content | 29 } // namespace content |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 | 56 |
| 53 // These methods map to Add methods in components::VisitedLinkMaster. | 57 // These methods map to Add methods in components::VisitedLinkMaster. |
| 54 void AddVisitedURLs(const std::vector<GURL>& urls); | 58 void AddVisitedURLs(const std::vector<GURL>& urls); |
| 55 | 59 |
| 56 // content::BrowserContext implementation. | 60 // content::BrowserContext implementation. |
| 57 virtual FilePath GetPath() OVERRIDE; | 61 virtual FilePath GetPath() OVERRIDE; |
| 58 virtual bool IsOffTheRecord() const OVERRIDE; | 62 virtual bool IsOffTheRecord() const OVERRIDE; |
| 59 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 63 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
| 60 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 64 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
| 61 int renderer_child_id) OVERRIDE; | 65 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; | 66 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; |
| 65 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 67 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
| 66 int renderer_child_id) OVERRIDE; | 68 int renderer_child_id) OVERRIDE; |
| 67 virtual net::URLRequestContextGetter* | 69 virtual net::URLRequestContextGetter* |
| 68 GetMediaRequestContextForStoragePartition( | 70 GetMediaRequestContextForStoragePartition( |
| 69 const FilePath& partition_path, bool in_memory) OVERRIDE; | 71 const FilePath& partition_path, bool in_memory) OVERRIDE; |
| 70 virtual content::ResourceContext* GetResourceContext() OVERRIDE; | 72 virtual content::ResourceContext* GetResourceContext() OVERRIDE; |
| 71 virtual content::DownloadManagerDelegate* | 73 virtual content::DownloadManagerDelegate* |
| 72 GetDownloadManagerDelegate() OVERRIDE; | 74 GetDownloadManagerDelegate() OVERRIDE; |
| 73 virtual content::GeolocationPermissionContext* | 75 virtual content::GeolocationPermissionContext* |
| 74 GetGeolocationPermissionContext() OVERRIDE; | 76 GetGeolocationPermissionContext() OVERRIDE; |
| 75 virtual content::SpeechRecognitionPreferences* | 77 virtual content::SpeechRecognitionPreferences* |
| 76 GetSpeechRecognitionPreferences() OVERRIDE; | 78 GetSpeechRecognitionPreferences() OVERRIDE; |
| 77 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 79 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
| 78 | 80 |
| 79 // components::VisitedLinkDelegate implementation. | 81 // components::VisitedLinkDelegate implementation. |
| 80 virtual void RebuildTable( | 82 virtual void RebuildTable( |
| 81 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; | 83 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; |
| 82 | 84 |
| 85 net::URLRequestContextGetter* CreateRequestContext( |
| 86 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 87 blob_protocol_handler, |
| 88 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 89 file_system_protocol_handler, |
| 90 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 91 developer_protocol_handler, |
| 92 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 93 chrome_protocol_handler, |
| 94 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 95 chrome_devtools_protocol_handler); |
| 96 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 97 const FilePath& partition_path, |
| 98 bool in_memory, |
| 99 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 100 blob_protocol_handler, |
| 101 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 102 file_system_protocol_handler, |
| 103 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 104 developer_protocol_handler, |
| 105 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 106 chrome_protocol_handler, |
| 107 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 108 chrome_devtools_protocol_handler); |
| 109 |
| 83 private: | 110 private: |
| 111 class AwResourceContext; |
| 84 | 112 |
| 85 // The file path where data for this context is persisted. | 113 // The file path where data for this context is persisted. |
| 86 FilePath context_storage_path_; | 114 FilePath context_storage_path_; |
| 87 | 115 |
| 88 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; | 116 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; |
| 89 GeolocationPermissionFactoryFn* geolocation_permission_factory_; | 117 GeolocationPermissionFactoryFn* geolocation_permission_factory_; |
| 90 scoped_refptr<content::GeolocationPermissionContext> | 118 scoped_refptr<content::GeolocationPermissionContext> |
| 91 geolocation_permission_context_; | 119 geolocation_permission_context_; |
| 92 | 120 |
| 93 AwDownloadManagerDelegate download_manager_delegate_; | 121 AwDownloadManagerDelegate download_manager_delegate_; |
| 94 | 122 |
| 95 scoped_ptr<components::VisitedLinkMaster> visitedlink_master_; | 123 scoped_ptr<components::VisitedLinkMaster> visitedlink_master_; |
| 124 scoped_ptr<AwResourceContext> resource_context_; |
| 96 | 125 |
| 97 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); | 126 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); |
| 98 }; | 127 }; |
| 99 | 128 |
| 100 } // namespace android_webview | 129 } // namespace android_webview |
| 101 | 130 |
| 102 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 131 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
| OLD | NEW |