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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 prefs->SetValue(pref_path_, network_configs.release()); | 256 prefs->SetValue(pref_path_, network_configs.release()); |
257 } | 257 } |
258 | 258 |
259 void NetworkConfigurationPolicyHandler::PrepareForDisplaying( | 259 void NetworkConfigurationPolicyHandler::PrepareForDisplaying( |
260 PolicyMap* policies) const { | 260 PolicyMap* policies) const { |
261 const PolicyMap::Entry* entry = policies->Get(policy_name()); | 261 const PolicyMap::Entry* entry = policies->Get(policy_name()); |
262 if (!entry) | 262 if (!entry) |
263 return; | 263 return; |
264 base::Value* sanitized_config = SanitizeNetworkConfig(entry->value); | 264 base::Value* sanitized_config = SanitizeNetworkConfig(entry->value); |
265 if (!sanitized_config) | 265 if (!sanitized_config) |
266 sanitized_config = base::Value::CreateNullValue(); | 266 sanitized_config = base::Value::CreateNullValue().release(); |
267 | 267 |
268 policies->Set(policy_name(), entry->level, entry->scope, | 268 policies->Set(policy_name(), entry->level, entry->scope, |
269 sanitized_config, NULL); | 269 sanitized_config, NULL); |
270 } | 270 } |
271 | 271 |
272 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler( | 272 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler( |
273 const char* policy_name, | 273 const char* policy_name, |
274 onc::ONCSource onc_source, | 274 onc::ONCSource onc_source, |
275 const char* pref_path) | 275 const char* pref_path) |
276 : TypeCheckingPolicyHandler(policy_name, base::Value::TYPE_STRING), | 276 : TypeCheckingPolicyHandler(policy_name, base::Value::TYPE_STRING), |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 474 |
475 value = GetValue(dict, kScreenLockDelayAC); | 475 value = GetValue(dict, kScreenLockDelayAC); |
476 if (value) | 476 if (value) |
477 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.release()); | 477 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.release()); |
478 value = GetValue(dict, kScreenLockDelayBattery); | 478 value = GetValue(dict, kScreenLockDelayBattery); |
479 if (value) | 479 if (value) |
480 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.release()); | 480 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.release()); |
481 } | 481 } |
482 | 482 |
483 } // namespace policy | 483 } // namespace policy |
OLD | NEW |