| 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/policy/configuration_policy_handler.h" | 5 #include "chrome/browser/policy/configuration_policy_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 } | 913 } |
| 914 | 914 |
| 915 const Value* ProxyPolicyHandler::GetProxyPolicyValue( | 915 const Value* ProxyPolicyHandler::GetProxyPolicyValue( |
| 916 const PolicyMap& policies, const char* policy_name) { | 916 const PolicyMap& policies, const char* policy_name) { |
| 917 // See note on the ProxyPolicyHandler implementation above. | 917 // See note on the ProxyPolicyHandler implementation above. |
| 918 const Value* value = policies.GetValue(key::kProxySettings); | 918 const Value* value = policies.GetValue(key::kProxySettings); |
| 919 const DictionaryValue* settings; | 919 const DictionaryValue* settings; |
| 920 if (!value || !value->GetAsDictionary(&settings)) | 920 if (!value || !value->GetAsDictionary(&settings)) |
| 921 return NULL; | 921 return NULL; |
| 922 | 922 |
| 923 Value* policy_value = NULL; | 923 const Value* policy_value = NULL; |
| 924 std::string tmp; | 924 std::string tmp; |
| 925 if (!settings->Get(policy_name, &policy_value) || | 925 if (!settings->Get(policy_name, &policy_value) || |
| 926 policy_value->IsType(Value::TYPE_NULL) || | 926 policy_value->IsType(Value::TYPE_NULL) || |
| 927 (policy_value->IsType(Value::TYPE_STRING) && | 927 (policy_value->IsType(Value::TYPE_STRING) && |
| 928 policy_value->GetAsString(&tmp) && | 928 policy_value->GetAsString(&tmp) && |
| 929 tmp.empty())) { | 929 tmp.empty())) { |
| 930 return NULL; | 930 return NULL; |
| 931 } | 931 } |
| 932 return policy_value; | 932 return policy_value; |
| 933 } | 933 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1268 errors->AddError(policy_name(), | 1268 errors->AddError(policy_name(), |
| 1269 IDS_POLICY_OUT_OF_RANGE_ERROR, | 1269 IDS_POLICY_OUT_OF_RANGE_ERROR, |
| 1270 base::IntToString(restore_value)); | 1270 base::IntToString(restore_value)); |
| 1271 } | 1271 } |
| 1272 } | 1272 } |
| 1273 } | 1273 } |
| 1274 return true; | 1274 return true; |
| 1275 } | 1275 } |
| 1276 | 1276 |
| 1277 } // namespace policy | 1277 } // namespace policy |
| OLD | NEW |