OLD | NEW |
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 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
" | 5 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h
" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 | 260 |
261 void NetworkConfigurationPolicyHandler::PrepareForDisplaying( | 261 void NetworkConfigurationPolicyHandler::PrepareForDisplaying( |
262 PolicyMap* policies) const { | 262 PolicyMap* policies) const { |
263 const PolicyMap::Entry* entry = policies->Get(policy_name()); | 263 const PolicyMap::Entry* entry = policies->Get(policy_name()); |
264 if (!entry) | 264 if (!entry) |
265 return; | 265 return; |
266 std::unique_ptr<base::Value> sanitized_config = | 266 std::unique_ptr<base::Value> sanitized_config = |
267 SanitizeNetworkConfig(entry->value.get()); | 267 SanitizeNetworkConfig(entry->value.get()); |
268 if (!sanitized_config) | 268 if (!sanitized_config) |
269 sanitized_config = base::Value::CreateNullValue(); | 269 sanitized_config = base::MakeUnique<base::Value>(); |
270 | 270 |
271 policies->Set(policy_name(), entry->level, entry->scope, entry->source, | 271 policies->Set(policy_name(), entry->level, entry->scope, entry->source, |
272 std::move(sanitized_config), nullptr); | 272 std::move(sanitized_config), nullptr); |
273 } | 273 } |
274 | 274 |
275 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler( | 275 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler( |
276 const char* policy_name, | 276 const char* policy_name, |
277 onc::ONCSource onc_source, | 277 onc::ONCSource onc_source, |
278 const char* pref_path) | 278 const char* pref_path) |
279 : TypeCheckingPolicyHandler(policy_name, base::Value::Type::STRING), | 279 : TypeCheckingPolicyHandler(policy_name, base::Value::Type::STRING), |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 476 |
477 value = GetValue(dict, kScreenLockDelayAC); | 477 value = GetValue(dict, kScreenLockDelayAC); |
478 if (value) | 478 if (value) |
479 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, std::move(value)); | 479 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, std::move(value)); |
480 value = GetValue(dict, kScreenLockDelayBattery); | 480 value = GetValue(dict, kScreenLockDelayBattery); |
481 if (value) | 481 if (value) |
482 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, std::move(value)); | 482 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, std::move(value)); |
483 } | 483 } |
484 | 484 |
485 } // namespace policy | 485 } // namespace policy |
OLD | NEW |