Chromium Code Reviews| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 virtual ~AwBrowserContext(); | 57 virtual ~AwBrowserContext(); |
| 58 | 58 |
| 59 // Currently only one instance per process is supported. | 59 // Currently only one instance per process is supported. |
| 60 static AwBrowserContext* GetDefault(); | 60 static AwBrowserContext* GetDefault(); |
| 61 | 61 |
| 62 // Convenience method to returns the AwBrowserContext corresponding to the | 62 // Convenience method to returns the AwBrowserContext corresponding to the |
| 63 // given WebContents. | 63 // given WebContents. |
| 64 static AwBrowserContext* FromWebContents( | 64 static AwBrowserContext* FromWebContents( |
| 65 content::WebContents* web_contents); | 65 content::WebContents* web_contents); |
| 66 | 66 |
| 67 static void SetDataReductionProxyEnabled(bool enabled); | |
|
boliu
2014/05/07 23:30:09
AwBrowserContext is effectively global already. Wh
| |
| 68 | |
| 67 // Maps to BrowserMainParts::PreMainMessageLoopRun. | 69 // Maps to BrowserMainParts::PreMainMessageLoopRun. |
| 68 void PreMainMessageLoopRun(); | 70 void PreMainMessageLoopRun(); |
| 69 | 71 |
| 70 // These methods map to Add methods in visitedlink::VisitedLinkMaster. | 72 // These methods map to Add methods in visitedlink::VisitedLinkMaster. |
| 71 void AddVisitedURLs(const std::vector<GURL>& urls); | 73 void AddVisitedURLs(const std::vector<GURL>& urls); |
| 72 | 74 |
| 73 net::URLRequestContextGetter* CreateRequestContext( | 75 net::URLRequestContextGetter* CreateRequestContext( |
| 74 content::ProtocolHandlerMap* protocol_handlers); | 76 content::ProtocolHandlerMap* protocol_handlers); |
| 75 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | 77 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 76 const base::FilePath& partition_path, | 78 const base::FilePath& partition_path, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 GetGeolocationPermissionContext() OVERRIDE; | 127 GetGeolocationPermissionContext() OVERRIDE; |
| 126 virtual content::BrowserPluginGuestManagerDelegate* | 128 virtual content::BrowserPluginGuestManagerDelegate* |
| 127 GetGuestManagerDelegate() OVERRIDE; | 129 GetGuestManagerDelegate() OVERRIDE; |
| 128 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 130 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; |
| 129 | 131 |
| 130 // visitedlink::VisitedLinkDelegate implementation. | 132 // visitedlink::VisitedLinkDelegate implementation. |
| 131 virtual void RebuildTable( | 133 virtual void RebuildTable( |
| 132 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; | 134 const scoped_refptr<URLEnumerator>& enumerator) OVERRIDE; |
| 133 | 135 |
| 134 private: | 136 private: |
| 137 static bool data_reduction_proxy_enabled_; | |
| 138 | |
| 135 // The file path where data for this context is persisted. | 139 // The file path where data for this context is persisted. |
| 136 base::FilePath context_storage_path_; | 140 base::FilePath context_storage_path_; |
| 137 | 141 |
| 138 JniDependencyFactory* native_factory_; | 142 JniDependencyFactory* native_factory_; |
| 139 scoped_refptr<net::CookieStore> cookie_store_; | 143 scoped_refptr<net::CookieStore> cookie_store_; |
| 140 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; | 144 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; |
| 141 scoped_refptr<content::GeolocationPermissionContext> | 145 scoped_refptr<content::GeolocationPermissionContext> |
| 142 geolocation_permission_context_; | 146 geolocation_permission_context_; |
| 143 scoped_refptr<AwQuotaManagerBridge> quota_manager_bridge_; | 147 scoped_refptr<AwQuotaManagerBridge> quota_manager_bridge_; |
| 144 scoped_ptr<AwFormDatabaseService> form_database_service_; | 148 scoped_ptr<AwFormDatabaseService> form_database_service_; |
| 145 | 149 |
| 146 AwDownloadManagerDelegate download_manager_delegate_; | 150 AwDownloadManagerDelegate download_manager_delegate_; |
| 147 | 151 |
| 148 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; | 152 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; |
| 149 scoped_ptr<content::ResourceContext> resource_context_; | 153 scoped_ptr<content::ResourceContext> resource_context_; |
| 150 | 154 |
| 151 scoped_ptr<PrefService> user_pref_service_; | 155 scoped_ptr<PrefService> user_pref_service_; |
| 152 | 156 |
| 153 scoped_ptr<DataReductionProxySettings> data_reduction_proxy_settings_; | 157 scoped_ptr<DataReductionProxySettings> data_reduction_proxy_settings_; |
| 154 | 158 |
| 155 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); | 159 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); |
| 156 }; | 160 }; |
| 157 | 161 |
| 158 } // namespace android_webview | 162 } // namespace android_webview |
| 159 | 163 |
| 160 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ | 164 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ |
| OLD | NEW |