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/policy_loader_win.h" | 5 #include "chrome/browser/policy/policy_loader_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 } | 89 } |
90 return true; | 90 return true; |
91 } | 91 } |
92 | 92 |
93 case base::Value::TYPE_LIST: { | 93 case base::Value::TYPE_LIST: { |
94 const base::ListValue* list = NULL; | 94 const base::ListValue* list = NULL; |
95 if (!value.GetAsList(&list)) | 95 if (!value.GetAsList(&list)) |
96 return false; | 96 return false; |
97 for (size_t i = 0; i < list->GetSize(); ++i) { | 97 for (size_t i = 0; i < list->GetSize(); ++i) { |
98 base::Value* item; | 98 const base::Value* item; |
99 if (!list->Get(i, &item)) | 99 if (!list->Get(i, &item)) |
100 return false; | 100 return false; |
101 if (!InstallValue(*item, hive, path + kPathSep + name, | 101 if (!InstallValue(*item, hive, path + kPathSep + name, |
102 base::UintToString16(i + 1))) { | 102 base::UintToString16(i + 1))) { |
103 return false; | 103 return false; |
104 } | 104 } |
105 } | 105 } |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 expected_policy.SetInteger("special-int2", -456); | 607 expected_policy.SetInteger("special-int2", -456); |
608 expected_policy.SetDouble("double1", 789.0); | 608 expected_policy.SetDouble("double1", 789.0); |
609 expected_policy.SetDouble("double2", 123.456e7); | 609 expected_policy.SetDouble("double2", 123.456e7); |
610 PolicyBundle expected; | 610 PolicyBundle expected; |
611 expected.Get(POLICY_DOMAIN_EXTENSIONS, "test") | 611 expected.Get(POLICY_DOMAIN_EXTENSIONS, "test") |
612 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); | 612 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); |
613 EXPECT_TRUE(Matches(expected)); | 613 EXPECT_TRUE(Matches(expected)); |
614 } | 614 } |
615 | 615 |
616 } // namespace policy | 616 } // namespace policy |
OLD | NEW |