Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/browser/policy/configuration_policy_handler.cc

Issue 10834004: Correct const accessors in base/values.(h|cc) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reverting webdriver:Command::parameters_ to const Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/plugin_finder_unittest.cc ('k') | chrome/browser/policy/policy_loader_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/plugin_finder_unittest.cc ('k') | chrome/browser/policy/policy_loader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698