OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "android_webview/browser/aw_browser_policy_connector.h" | 5 #include "android_webview/browser/aw_browser_policy_connector.h" |
6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" |
7 #include "base/bind.h" | 8 #include "base/bind.h" |
8 #include "components/policy/core/browser/android/android_combined_policy_provide
r.h" | 9 #include "components/policy/core/browser/android/android_combined_policy_provide
r.h" |
9 #include "components/policy/core/browser/configuration_policy_handler_list.h" | 10 #include "components/policy/core/browser/configuration_policy_handler_list.h" |
10 #include "components/policy/core/browser/url_blacklist_policy_handler.h" | 11 #include "components/policy/core/browser/url_blacklist_policy_handler.h" |
11 #include "components/policy/core/common/policy_pref_names.h" | 12 #include "components/policy/core/common/policy_pref_names.h" |
12 #include "net/url_request/url_request_context_getter.h" | 13 #include "net/url_request/url_request_context_getter.h" |
13 #include "policy/policy_constants.h" | 14 #include "policy/policy_constants.h" |
14 | 15 |
15 namespace android_webview { | 16 namespace android_webview { |
16 | 17 |
(...skipping 10 matching lines...) Expand all Loading... |
27 | 28 |
28 // Factory for the handlers that will be responsible for converting the policies | 29 // Factory for the handlers that will be responsible for converting the policies |
29 // to the associated preferences. | 30 // to the associated preferences. |
30 scoped_ptr<policy::ConfigurationPolicyHandlerList> BuildHandlerList( | 31 scoped_ptr<policy::ConfigurationPolicyHandlerList> BuildHandlerList( |
31 const policy::Schema& chrome_schema) { | 32 const policy::Schema& chrome_schema) { |
32 scoped_ptr<policy::ConfigurationPolicyHandlerList> handlers( | 33 scoped_ptr<policy::ConfigurationPolicyHandlerList> handlers( |
33 new policy::ConfigurationPolicyHandlerList( | 34 new policy::ConfigurationPolicyHandlerList( |
34 base::Bind(&PopulatePolicyHandlerParameters), | 35 base::Bind(&PopulatePolicyHandlerParameters), |
35 base::Bind(&GetChromePolicyDetails))); | 36 base::Bind(&GetChromePolicyDetails))); |
36 | 37 |
| 38 // URL Filtering |
37 handlers->AddHandler(make_scoped_ptr(new policy::SimplePolicyHandler( | 39 handlers->AddHandler(make_scoped_ptr(new policy::SimplePolicyHandler( |
38 policy::key::kURLWhitelist, policy::policy_prefs::kUrlWhitelist, | 40 policy::key::kURLWhitelist, policy::policy_prefs::kUrlWhitelist, |
39 base::Value::TYPE_LIST))); | 41 base::Value::TYPE_LIST))); |
40 | |
41 handlers->AddHandler( | 42 handlers->AddHandler( |
42 make_scoped_ptr(new policy::URLBlacklistPolicyHandler())); | 43 make_scoped_ptr(new policy::URLBlacklistPolicyHandler())); |
| 44 |
| 45 // HTTP Negotiate authentication |
| 46 handlers->AddHandler(make_scoped_ptr(new policy::SimplePolicyHandler( |
| 47 policy::key::kAuthServerWhitelist, prefs::kAuthServerWhitelist, |
| 48 base::Value::TYPE_STRING))); |
| 49 handlers->AddHandler(make_scoped_ptr(new policy::SimplePolicyHandler( |
| 50 policy::key::kAuthAndroidNegotiateAccountType, |
| 51 prefs::kAuthAndroidNegotiateAccountType, base::Value::TYPE_STRING))); |
| 52 |
43 return handlers.Pass(); | 53 return handlers.Pass(); |
44 } | 54 } |
45 | 55 |
46 } // namespace | 56 } // namespace |
47 | 57 |
48 AwBrowserPolicyConnector::AwBrowserPolicyConnector() | 58 AwBrowserPolicyConnector::AwBrowserPolicyConnector() |
49 : BrowserPolicyConnectorBase(base::Bind(&BuildHandlerList)) { | 59 : BrowserPolicyConnectorBase(base::Bind(&BuildHandlerList)) { |
50 SetPlatformPolicyProvider(make_scoped_ptr( | 60 SetPlatformPolicyProvider(make_scoped_ptr( |
51 new policy::android::AndroidCombinedPolicyProvider(GetSchemaRegistry()))); | 61 new policy::android::AndroidCombinedPolicyProvider(GetSchemaRegistry()))); |
52 InitPolicyProviders(); | 62 InitPolicyProviders(); |
53 } | 63 } |
54 | 64 |
55 AwBrowserPolicyConnector::~AwBrowserPolicyConnector() {} | 65 AwBrowserPolicyConnector::~AwBrowserPolicyConnector() {} |
56 | 66 |
57 } // namespace android_webview | 67 } // namespace android_webview |
OLD | NEW |