Index: android_webview/browser/aw_browser_context.cc |
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc |
index d5252bd244746c99d3ee9727fb838b0b5664a800..91c5e6c4ceb65407f5559b8f0f4874e984b8406a 100644 |
--- a/android_webview/browser/aw_browser_context.cc |
+++ b/android_webview/browser/aw_browser_context.cc |
@@ -59,6 +59,8 @@ const char kAuthAndroidNegotiateAccountType[] = |
// Whitelist containing servers for which Integrated Authentication is enabled. |
const char kAuthServerWhitelist[] = "auth.server_whitelist"; |
+const char kWebRestrictionsAuthority[] = "web_restrictions_authority"; |
+ |
} // namespace prefs |
namespace { |
@@ -262,6 +264,19 @@ void AwBrowserContext::PreMainMessageLoopRun() { |
AwMetricsServiceClient::GetInstance()->Initialize(user_pref_service_.get(), |
GetRequestContext(), |
guid_file_path); |
+ web_restriction_provider_.reset( |
+ new web_restrictions::WebRestrictionsClient()); |
+ web_restrictions_authority_.Init( |
+ prefs::kWebRestrictionsAuthority, user_pref_service_.get(), |
+ base::Bind(&AwBrowserContext::OnWebRestrictionsAuthorityChanged, |
+ base::Unretained(this))); |
+ web_restriction_provider_->SetAuthority( |
+ web_restrictions_authority_.GetValue()); |
+} |
+ |
+void AwBrowserContext::OnWebRestrictionsAuthorityChanged() { |
+ web_restriction_provider_->SetAuthority( |
+ web_restrictions_authority_.GetValue()); |
} |
void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { |
@@ -317,6 +332,8 @@ void AwBrowserContext::InitUserPrefService() { |
pref_registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); |
pref_registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, |
std::string()); |
+ pref_registry->RegisterStringPref(prefs::kWebRestrictionsAuthority, |
+ std::string()); |
metrics::MetricsService::RegisterPrefs(pref_registry); |
@@ -446,6 +463,12 @@ policy::URLBlacklistManager* AwBrowserContext::GetURLBlacklistManager() { |
return blacklist_manager_.get(); |
} |
+web_restrictions::WebRestrictionsClient* |
+AwBrowserContext::GetWebRestrictionProvider() { |
+ DCHECK(web_restriction_provider_); |
+ return web_restriction_provider_.get(); |
+} |
+ |
void AwBrowserContext::RebuildTable( |
const scoped_refptr<URLEnumerator>& enumerator) { |
// Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client |