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

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: Fix final nits Created 4 years, 4 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
« no previous file with comments | « android_webview/browser/DEPS ('k') | android_webview/browser/aw_browser_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_change_registrar.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 15 matching lines...) Expand all
44 class AwFormDatabaseService; 46 class AwFormDatabaseService;
45 class AwQuotaManagerBridge; 47 class AwQuotaManagerBridge;
46 class AwURLRequestContextGetter; 48 class AwURLRequestContextGetter;
47 class JniDependencyFactory; 49 class JniDependencyFactory;
48 50
49 namespace prefs { 51 namespace prefs {
50 52
51 // Used for Kerberos authentication. 53 // Used for Kerberos authentication.
52 extern const char kAuthAndroidNegotiateAccountType[]; 54 extern const char kAuthAndroidNegotiateAccountType[];
53 extern const char kAuthServerWhitelist[]; 55 extern const char kAuthServerWhitelist[];
56 extern const char kWebRestrictionsAuthority[];
54 57
55 } // namespace prefs 58 } // namespace prefs
56 59
57 class AwBrowserContext : public content::BrowserContext, 60 class AwBrowserContext : public content::BrowserContext,
58 public visitedlink::VisitedLinkDelegate { 61 public visitedlink::VisitedLinkDelegate {
59 public: 62 public:
60 63
61 AwBrowserContext(const base::FilePath path, 64 AwBrowserContext(const base::FilePath path,
62 JniDependencyFactory* native_factory); 65 JniDependencyFactory* native_factory);
63 ~AwBrowserContext() override; 66 ~AwBrowserContext() override;
(...skipping 13 matching lines...) Expand all
77 80
78 // These methods map to Add methods in visitedlink::VisitedLinkMaster. 81 // These methods map to Add methods in visitedlink::VisitedLinkMaster.
79 void AddVisitedURLs(const std::vector<GURL>& urls); 82 void AddVisitedURLs(const std::vector<GURL>& urls);
80 83
81 AwQuotaManagerBridge* GetQuotaManagerBridge(); 84 AwQuotaManagerBridge* GetQuotaManagerBridge();
82 AwFormDatabaseService* GetFormDatabaseService(); 85 AwFormDatabaseService* GetFormDatabaseService();
83 AwURLRequestContextGetter* GetAwURLRequestContext(); 86 AwURLRequestContextGetter* GetAwURLRequestContext();
84 AwMessagePortService* GetMessagePortService(); 87 AwMessagePortService* GetMessagePortService();
85 88
86 policy::URLBlacklistManager* GetURLBlacklistManager(); 89 policy::URLBlacklistManager* GetURLBlacklistManager();
90 web_restrictions::WebRestrictionsClient* GetWebRestrictionProvider();
87 91
88 // content::BrowserContext implementation. 92 // content::BrowserContext implementation.
89 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate( 93 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
90 const base::FilePath& partition_path) override; 94 const base::FilePath& partition_path) override;
91 base::FilePath GetPath() const override; 95 base::FilePath GetPath() const override;
92 bool IsOffTheRecord() const override; 96 bool IsOffTheRecord() const override;
93 content::ResourceContext* GetResourceContext() override; 97 content::ResourceContext* GetResourceContext() override;
94 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; 98 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
95 content::BrowserPluginGuestManager* GetGuestManager() override; 99 content::BrowserPluginGuestManager* GetGuestManager() override;
96 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; 100 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
(...skipping 12 matching lines...) Expand all
109 net::URLRequestContextGetter* CreateMediaRequestContext() override; 113 net::URLRequestContextGetter* CreateMediaRequestContext() override;
110 net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition( 114 net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
111 const base::FilePath& partition_path, 115 const base::FilePath& partition_path,
112 bool in_memory) override; 116 bool in_memory) override;
113 117
114 // visitedlink::VisitedLinkDelegate implementation. 118 // visitedlink::VisitedLinkDelegate implementation.
115 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override; 119 void RebuildTable(const scoped_refptr<URLEnumerator>& enumerator) override;
116 120
117 private: 121 private:
118 void InitUserPrefService(); 122 void InitUserPrefService();
123 void OnWebRestrictionsAuthorityChanged();
124
119 125
120 // Delay, in milliseconds, before removing the legacy cache dir. 126 // Delay, in milliseconds, before removing the legacy cache dir.
121 // This is non-const for testing purposes. 127 // This is non-const for testing purposes.
122 static int legacy_cache_removal_delay_ms_; 128 static int legacy_cache_removal_delay_ms_;
123 129
124 // The file path where data for this context is persisted. 130 // The file path where data for this context is persisted.
125 base::FilePath context_storage_path_; 131 base::FilePath context_storage_path_;
126 132
127 JniDependencyFactory* native_factory_; 133 JniDependencyFactory* native_factory_;
128 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_; 134 scoped_refptr<AwURLRequestContextGetter> url_request_context_getter_;
129 scoped_refptr<AwQuotaManagerBridge> quota_manager_bridge_; 135 scoped_refptr<AwQuotaManagerBridge> quota_manager_bridge_;
130 std::unique_ptr<AwFormDatabaseService> form_database_service_; 136 std::unique_ptr<AwFormDatabaseService> form_database_service_;
131 std::unique_ptr<AwMessagePortService> message_port_service_; 137 std::unique_ptr<AwMessagePortService> message_port_service_;
132 138
133 AwDownloadManagerDelegate download_manager_delegate_; 139 AwDownloadManagerDelegate download_manager_delegate_;
134 140
135 std::unique_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; 141 std::unique_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_;
136 std::unique_ptr<content::ResourceContext> resource_context_; 142 std::unique_ptr<content::ResourceContext> resource_context_;
137 143
138 std::unique_ptr<PrefService> user_pref_service_; 144 std::unique_ptr<PrefService> user_pref_service_;
139 std::unique_ptr<policy::BrowserPolicyConnectorBase> browser_policy_connector_; 145 std::unique_ptr<policy::BrowserPolicyConnectorBase> browser_policy_connector_;
140 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_; 146 std::unique_ptr<policy::URLBlacklistManager> blacklist_manager_;
141 147
142 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_; 148 std::unique_ptr<AwSSLHostStateDelegate> ssl_host_state_delegate_;
143 std::unique_ptr<content::PermissionManager> permission_manager_; 149 std::unique_ptr<content::PermissionManager> permission_manager_;
150 std::unique_ptr<web_restrictions::WebRestrictionsClient>
151 web_restriction_provider_;
152 PrefChangeRegistrar pref_change_registrar_;
144 153
145 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); 154 DISALLOW_COPY_AND_ASSIGN(AwBrowserContext);
146 }; 155 };
147 156
148 } // namespace android_webview 157 } // namespace android_webview
149 158
150 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_ 159 #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_CONTEXT_H_
OLDNEW
« no previous file with comments | « android_webview/browser/DEPS ('k') | android_webview/browser/aw_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698