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

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: Created 4 years, 8 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/prefs/pref_member.h"
18 #include "components/visitedlink/browser/visitedlink_delegate.h" 19 #include "components/visitedlink/browser/visitedlink_delegate.h"
20 #include "components/web_restrictions/browser/web_restrictions_client.h"
19 #include "content/public/browser/browser_context.h" 21 #include "content/public/browser/browser_context.h"
20 #include "content/public/browser/content_browser_client.h" 22 #include "content/public/browser/content_browser_client.h"
21 #include "net/url_request/url_request_job_factory.h" 23 #include "net/url_request/url_request_job_factory.h"
22 24
23 class GURL; 25 class GURL;
24 class PrefService; 26 class PrefService;
25 27
26 namespace content { 28 namespace content {
27 class PermissionManager; 29 class PermissionManager;
28 class ResourceContext; 30 class ResourceContext;
(...skipping 22 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 net::URLRequestContextGetter* GetRequestContext() override; 109 net::URLRequestContextGetter* GetRequestContext() override;
106 net::URLRequestContextGetter* GetMediaRequestContext() override; 110 net::URLRequestContextGetter* GetMediaRequestContext() override;
107 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( 111 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
108 int renderer_child_id) override; 112 int renderer_child_id) override;
(...skipping 16 matching lines...) Expand all
125 bool in_memory, 129 bool in_memory,
126 content::ProtocolHandlerMap* protocol_handlers, 130 content::ProtocolHandlerMap* protocol_handlers,
127 content::URLRequestInterceptorScopedVector request_interceptors) override; 131 content::URLRequestInterceptorScopedVector request_interceptors) override;
128 132
129 // visitedlink::VisitedLinkDelegate implementation. 133 // visitedlink::VisitedLinkDelegate implementation.
130 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override; 134 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override;
131 135
132 private: 136 private:
133 void InitUserPrefService(); 137 void InitUserPrefService();
134 void CreateDataReductionProxyStatisticsIfNecessary(); 138 void CreateDataReductionProxyStatisticsIfNecessary();
139 void OnWebRestrictionsAuthorityChanged();
140
135 static bool data_reduction_proxy_enabled_; 141 static bool data_reduction_proxy_enabled_;
136 142
137 // Delay, in milliseconds, before removing the legacy cache dir. 143 // Delay, in milliseconds, before removing the legacy cache dir.
138 // This is non-const for testing purposes. 144 // This is non-const for testing purposes.
139 static int legacy_cache_removal_delay_ms_; 145 static int legacy_cache_removal_delay_ms_;
140 146
141 // The file path where data for this context is persisted. 147 // The file path where data for this context is persisted.
142 base::FilePath context_storage_path_; 148 base::FilePath context_storage_path_;
143 149
144 JniDependencyFactory* native_factory_; 150 JniDependencyFactory* native_factory_;
(...skipping 12 matching lines...) Expand all
157 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_; 163 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_;
158 164
159 std::unique_ptr<data_reduction_proxy::DataReductionProxySettings> 165 std::unique_ptr<data_reduction_proxy::DataReductionProxySettings>
160 data_reduction_proxy_settings_; 166 data_reduction_proxy_settings_;
161 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_; 167 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_;
162 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> 168 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
163 data_reduction_proxy_io_data_; 169 data_reduction_proxy_io_data_;
164 std::unique_ptr<data_reduction_proxy::DataReductionProxyService> 170 std::unique_ptr<data_reduction_proxy::DataReductionProxyService>
165 data_reduction_proxy_service_; 171 data_reduction_proxy_service_;
166 std::unique_ptr<content::PermissionManager> permission_manager_; 172 std::unique_ptr<content::PermissionManager> permission_manager_;
173 std::unique_ptr<web_restrictions::WebRestrictionsClient>
174 web_restriction_provider_;
175 StringPrefMember web_restrictions_authority_;
Bernhard Bauer 2016/04/18 14:48:34 You only need a PrefMember if you want to read the
aberent 2016/05/18 20:06:49 Done.
167 176
168 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); 177 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext);
169 }; 178 };
170 179
171 } // namespace android_webview 180 } // namespace android_webview
172 181
173 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ 182 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698