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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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().release(); | 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 entry->source, sanitized_config, nullptr); | 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), |
277 onc_source_(onc_source), | 277 onc_source_(onc_source), |
278 pref_path_(pref_path) { | 278 pref_path_(pref_path) { |
279 } | 279 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 472 |
473 value = GetValue(dict, kScreenLockDelayAC); | 473 value = GetValue(dict, kScreenLockDelayAC); |
474 if (value) | 474 if (value) |
475 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.Pass()); | 475 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.Pass()); |
476 value = GetValue(dict, kScreenLockDelayBattery); | 476 value = GetValue(dict, kScreenLockDelayBattery); |
477 if (value) | 477 if (value) |
478 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.Pass()); | 478 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.Pass()); |
479 } | 479 } |
480 | 480 |
481 } // namespace policy | 481 } // namespace policy |
OLD | NEW |