| 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 | 8 |
| 9 #include "ash/magnifier/magnifier_constants.h" | 9 #include "ash/magnifier/magnifier_constants.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 PrefValueMap* prefs) { | 98 PrefValueMap* prefs) { |
| 99 const base::Value* value = policies.GetValue(policy_name()); | 99 const base::Value* value = policies.GetValue(policy_name()); |
| 100 if (!value) | 100 if (!value) |
| 101 return; | 101 return; |
| 102 | 102 |
| 103 std::string onc_blob; | 103 std::string onc_blob; |
| 104 value->GetAsString(&onc_blob); | 104 value->GetAsString(&onc_blob); |
| 105 | 105 |
| 106 scoped_ptr<base::ListValue> network_configs(new base::ListValue); | 106 scoped_ptr<base::ListValue> network_configs(new base::ListValue); |
| 107 base::ListValue certificates; | 107 base::ListValue certificates; |
| 108 chromeos::onc::ParseAndValidateOncForImport( | 108 base::DictionaryValue global_network_config; |
| 109 onc_blob, onc_source_, "", network_configs.get(), &certificates); | 109 chromeos::onc::ParseAndValidateOncForImport(onc_blob, |
| 110 onc_source_, |
| 111 "", |
| 112 network_configs.get(), |
| 113 &global_network_config, |
| 114 &certificates); |
| 110 | 115 |
| 116 // Currently, only the per-network configuration is stored in a pref. Ignore |
| 117 // |global_network_config| and |certificates|. |
| 111 prefs->SetValue(pref_path_, network_configs.release()); | 118 prefs->SetValue(pref_path_, network_configs.release()); |
| 112 } | 119 } |
| 113 | 120 |
| 114 void NetworkConfigurationPolicyHandler::PrepareForDisplaying( | 121 void NetworkConfigurationPolicyHandler::PrepareForDisplaying( |
| 115 PolicyMap* policies) const { | 122 PolicyMap* policies) const { |
| 116 const PolicyMap::Entry* entry = policies->Get(policy_name()); | 123 const PolicyMap::Entry* entry = policies->Get(policy_name()); |
| 117 if (!entry) | 124 if (!entry) |
| 118 return; | 125 return; |
| 119 base::Value* sanitized_config = SanitizeNetworkConfig(entry->value); | 126 base::Value* sanitized_config = SanitizeNetworkConfig(entry->value); |
| 120 if (!sanitized_config) | 127 if (!sanitized_config) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 const base::Value* value = policies.GetValue(policy_name()); | 260 const base::Value* value = policies.GetValue(policy_name()); |
| 254 if (value && EnsureInRange(value, NULL, NULL)) { | 261 if (value && EnsureInRange(value, NULL, NULL)) { |
| 255 if (!prefs->GetValue(prefs::kPowerAcIdleAction, NULL)) | 262 if (!prefs->GetValue(prefs::kPowerAcIdleAction, NULL)) |
| 256 prefs->SetValue(prefs::kPowerAcIdleAction, value->DeepCopy()); | 263 prefs->SetValue(prefs::kPowerAcIdleAction, value->DeepCopy()); |
| 257 if (!prefs->GetValue(prefs::kPowerBatteryIdleAction, NULL)) | 264 if (!prefs->GetValue(prefs::kPowerBatteryIdleAction, NULL)) |
| 258 prefs->SetValue(prefs::kPowerBatteryIdleAction, value->DeepCopy()); | 265 prefs->SetValue(prefs::kPowerBatteryIdleAction, value->DeepCopy()); |
| 259 } | 266 } |
| 260 } | 267 } |
| 261 | 268 |
| 262 } // namespace policy | 269 } // namespace policy |
| OLD | NEW |