Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: android_webview/browser/aw_browser_context.h

Issue 1890203002: Implement Web Restrictions in WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments, and fix a possible race in displaying error page Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "android_webview/browser/aw_download_manager_delegate.h" 11 #include "android_webview/browser/aw_download_manager_delegate.h"
12 #include "android_webview/browser/aw_message_port_service.h" 12 #include "android_webview/browser/aw_message_port_service.h"
13 #include "android_webview/browser/aw_ssl_host_state_delegate.h" 13 #include "android_webview/browser/aw_ssl_host_state_delegate.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "components/visitedlink/browser/visitedlink_delegate.h" 18 #include "components/visitedlink/browser/visitedlink_delegate.h"
19 #include "components/web_restrictions/browser/web_restrictions_client.h"
19 #include "content/public/browser/browser_context.h" 20 #include "content/public/browser/browser_context.h"
20 #include "content/public/browser/content_browser_client.h" 21 #include "content/public/browser/content_browser_client.h"
21 #include "net/url_request/url_request_job_factory.h" 22 #include "net/url_request/url_request_job_factory.h"
22 23
23 class GURL; 24 class GURL;
24 class PrefService; 25 class PrefService;
26 class PrefChangeRegistrar;
25 27
26 namespace content { 28 namespace content {
27 class PermissionManager; 29 class PermissionManager;
28 class ResourceContext; 30 class ResourceContext;
29 class SSLHostStateDelegate; 31 class SSLHostStateDelegate;
30 class WebContents; 32 class WebContents;
31 } 33 }
32 34
33 namespace data_reduction_proxy { 35 namespace data_reduction_proxy {
34 class DataReductionProxyConfigurator; 36 class DataReductionProxyConfigurator;
(...skipping 16 matching lines...) Expand all
51 class AwFormDatabaseService; 53 class AwFormDatabaseService;
52 class AwQuotaManagerBridge; 54 class AwQuotaManagerBridge;
53 class AwURLRequestContextGetter; 55 class AwURLRequestContextGetter;
54 class JniDependencyFactory; 56 class JniDependencyFactory;
55 57
56 namespace prefs { 58 namespace prefs {
57 59
58 // Used for Kerberos authentication. 60 // Used for Kerberos authentication.
59 extern const char kAuthAndroidNegotiateAccountType[]; 61 extern const char kAuthAndroidNegotiateAccountType[];
60 extern const char kAuthServerWhitelist[]; 62 extern const char kAuthServerWhitelist[];
63 extern const char kWebRestrictionsAuthority[];
61 64
62 } // namespace prefs 65 } // namespace prefs
63 66
64 class AwBrowserContext : public content::BrowserContext, 67 class AwBrowserContext : public content::BrowserContext,
65 public visitedlink::VisitedLinkDelegate { 68 public visitedlink::VisitedLinkDelegate {
66 public: 69 public:
67 70
68 AwBrowserContext(const base::FilePath path, 71 AwBrowserContext(const base::FilePath path,
69 JniDependencyFactory* native_factory); 72 JniDependencyFactory* native_factory);
70 ~AwBrowserContext() override; 73 ~AwBrowserContext() override;
(...skipping 18 matching lines...) Expand all
89 AwQuotaManagerBridge* GetQuotaManagerBridge(); 92 AwQuotaManagerBridge* GetQuotaManagerBridge();
90 AwFormDatabaseService* GetFormDatabaseService(); 93 AwFormDatabaseService* GetFormDatabaseService();
91 data_reduction_proxy::DataReductionProxySettings* 94 data_reduction_proxy::DataReductionProxySettings*
92 GetDataReductionProxySettings(); 95 GetDataReductionProxySettings();
93 data_reduction_proxy::DataReductionProxyIOData* 96 data_reduction_proxy::DataReductionProxyIOData*
94 GetDataReductionProxyIOData(); 97 GetDataReductionProxyIOData();
95 AwURLRequestContextGetter* GetAwURLRequestContext(); 98 AwURLRequestContextGetter* GetAwURLRequestContext();
96 AwMessagePortService* GetMessagePortService(); 99 AwMessagePortService* GetMessagePortService();
97 100
98 policy::URLBlacklistManager* GetURLBlacklistManager(); 101 policy::URLBlacklistManager* GetURLBlacklistManager();
102 web_restrictions::WebRestrictionsClient* GetWebRestrictionProvider();
99 103
100 // content::BrowserContext implementation. 104 // content::BrowserContext implementation.
101 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate( 105 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
102 const base::FilePath& partition_path) override; 106 const base::FilePath& partition_path) override;
103 base::FilePath GetPath() const override; 107 base::FilePath GetPath() const override;
104 bool IsOffTheRecord() const override; 108 bool IsOffTheRecord() const override;
105 content::ResourceContext* GetResourceContext() override; 109 content::ResourceContext* GetResourceContext() override;
106 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; 110 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
107 content::BrowserPluginGuestManager* GetGuestManager() override; 111 content::BrowserPluginGuestManager* GetGuestManager() override;
108 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; 112 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
(...skipping 13 matching lines...) Expand all
122 net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition( 126 net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
123 const base::FilePath& partition_path, 127 const base::FilePath& partition_path,
124 bool in_memory) override; 128 bool in_memory) override;
125 129
126 // visitedlink::VisitedLinkDelegate implementation. 130 // visitedlink::VisitedLinkDelegate implementation.
127 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override; 131 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override;
128 132
129 private: 133 private:
130 void InitUserPrefService(); 134 void InitUserPrefService();
131 void CreateDataReductionProxyStatisticsIfNecessary(); 135 void CreateDataReductionProxyStatisticsIfNecessary();
136 void OnWebRestrictionsAuthorityChanged();
137
132 static bool data_reduction_proxy_enabled_; 138 static bool data_reduction_proxy_enabled_;
133 139
134 // Delay, in milliseconds, before removing the legacy cache dir. 140 // Delay, in milliseconds, before removing the legacy cache dir.
135 // This is non-const for testing purposes. 141 // This is non-const for testing purposes.
136 static int legacy_cache_removal_delay_ms_; 142 static int legacy_cache_removal_delay_ms_;
137 143
138 // The file path where data for this context is persisted. 144 // The file path where data for this context is persisted.
139 base::FilePath context_storage_path_; 145 base::FilePath context_storage_path_;
140 146
141 JniDependencyFactory* native_factory_; 147 JniDependencyFactory* native_factory_;
(...skipping 12 matching lines...) Expand all
154 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_; 160 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_;
155 161
156 std::unique_ptr<data_reduction_proxy::DataReductionProxySettings> 162 std::unique_ptr<data_reduction_proxy::DataReductionProxySettings>
157 data_reduction_proxy_settings_; 163 data_reduction_proxy_settings_;
158 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_; 164 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_;
159 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> 165 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
160 data_reduction_proxy_io_data_; 166 data_reduction_proxy_io_data_;
161 std::unique_ptr<data_reduction_proxy::DataReductionProxyService> 167 std::unique_ptr<data_reduction_proxy::DataReductionProxyService>
162 data_reduction_proxy_service_; 168 data_reduction_proxy_service_;
163 std::unique_ptr<content::PermissionManager> permission_manager_; 169 std::unique_ptr<content::PermissionManager> permission_manager_;
170 std::unique_ptr<web_restrictions::WebRestrictionsClient>
171 web_restriction_provider_;
172 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_;
Bernhard Bauer 2016/05/19 10:00:15 You could make the PrefChangeRegistrar a direct me
aberent 2016/05/19 15:44:02 Done.
164 173
165 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); 174 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext);
166 }; 175 };
167 176
168 } // namespace android_webview 177 } // namespace android_webview
169 178
170 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ 179 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698