| 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 "android_webview/browser/aw_browser_context.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "components/policy/core/browser/android/android_combined_policy_provide
r.h" | 10 #include "components/policy/core/browser/android/android_combined_policy_provide
r.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Factory for the handlers that will be responsible for converting the policies | 30 // Factory for the handlers that will be responsible for converting the policies |
| 31 // to the associated preferences. | 31 // to the associated preferences. |
| 32 std::unique_ptr<policy::ConfigurationPolicyHandlerList> BuildHandlerList( | 32 std::unique_ptr<policy::ConfigurationPolicyHandlerList> BuildHandlerList( |
| 33 const policy::Schema& chrome_schema) { | 33 const policy::Schema& chrome_schema) { |
| 34 std::unique_ptr<policy::ConfigurationPolicyHandlerList> handlers( | 34 std::unique_ptr<policy::ConfigurationPolicyHandlerList> handlers( |
| 35 new policy::ConfigurationPolicyHandlerList( | 35 new policy::ConfigurationPolicyHandlerList( |
| 36 base::Bind(&PopulatePolicyHandlerParameters), | 36 base::Bind(&PopulatePolicyHandlerParameters), |
| 37 base::Bind(&GetChromePolicyDetails))); | 37 base::Bind(&GetChromePolicyDetails))); |
| 38 | 38 |
| 39 // URL Filtering | 39 // URL Filtering |
| 40 handlers->AddHandler(base::WrapUnique(new policy::SimplePolicyHandler( | 40 handlers->AddHandler(base::MakeUnique<policy::SimplePolicyHandler>( |
| 41 policy::key::kURLWhitelist, policy::policy_prefs::kUrlWhitelist, | 41 policy::key::kURLWhitelist, policy::policy_prefs::kUrlWhitelist, |
| 42 base::Value::TYPE_LIST))); | 42 base::Value::TYPE_LIST)); |
| 43 handlers->AddHandler( | 43 handlers->AddHandler(base::MakeUnique<policy::URLBlacklistPolicyHandler>()); |
| 44 base::WrapUnique(new policy::URLBlacklistPolicyHandler())); | |
| 45 | 44 |
| 46 // HTTP Negotiate authentication | 45 // HTTP Negotiate authentication |
| 47 handlers->AddHandler(base::WrapUnique(new policy::SimplePolicyHandler( | 46 handlers->AddHandler(base::MakeUnique<policy::SimplePolicyHandler>( |
| 48 policy::key::kAuthServerWhitelist, prefs::kAuthServerWhitelist, | 47 policy::key::kAuthServerWhitelist, prefs::kAuthServerWhitelist, |
| 49 base::Value::TYPE_STRING))); | 48 base::Value::TYPE_STRING)); |
| 50 handlers->AddHandler(base::WrapUnique(new policy::SimplePolicyHandler( | 49 handlers->AddHandler(base::MakeUnique<policy::SimplePolicyHandler>( |
| 51 policy::key::kAuthAndroidNegotiateAccountType, | 50 policy::key::kAuthAndroidNegotiateAccountType, |
| 52 prefs::kAuthAndroidNegotiateAccountType, base::Value::TYPE_STRING))); | 51 prefs::kAuthAndroidNegotiateAccountType, base::Value::TYPE_STRING)); |
| 53 | 52 |
| 54 return handlers; | 53 return handlers; |
| 55 } | 54 } |
| 56 | 55 |
| 57 } // namespace | 56 } // namespace |
| 58 | 57 |
| 59 AwBrowserPolicyConnector::AwBrowserPolicyConnector() | 58 AwBrowserPolicyConnector::AwBrowserPolicyConnector() |
| 60 : BrowserPolicyConnectorBase(base::Bind(&BuildHandlerList)) { | 59 : BrowserPolicyConnectorBase(base::Bind(&BuildHandlerList)) { |
| 61 SetPlatformPolicyProvider(base::WrapUnique( | 60 SetPlatformPolicyProvider( |
| 62 new policy::android::AndroidCombinedPolicyProvider(GetSchemaRegistry()))); | 61 base::MakeUnique<policy::android::AndroidCombinedPolicyProvider>( |
| 62 GetSchemaRegistry())); |
| 63 InitPolicyProviders(); | 63 InitPolicyProviders(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 AwBrowserPolicyConnector::~AwBrowserPolicyConnector() {} | 66 AwBrowserPolicyConnector::~AwBrowserPolicyConnector() {} |
| 67 | 67 |
| 68 } // namespace android_webview | 68 } // namespace android_webview |
| OLD | NEW |