| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/configuration_policy_provider_win.h" | 5 #include "chrome/browser/configuration_policy_provider_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/registry.h" | 10 #include "base/registry.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 current != mapping->end(); ++current) { | 97 current != mapping->end(); ++current) { |
| 98 std::wstring name = UTF8ToWide(current->name); | 98 std::wstring name = UTF8ToWide(current->name); |
| 99 std::wstring string_value; | 99 std::wstring string_value; |
| 100 uint32 int_value; | 100 uint32 int_value; |
| 101 bool bool_value; | 101 bool bool_value; |
| 102 switch (current->value_type) { | 102 switch (current->value_type) { |
| 103 case Value::TYPE_STRING: | 103 case Value::TYPE_STRING: |
| 104 if (GetRegistryPolicyString(name.c_str(), &string_value)) { | 104 if (GetRegistryPolicyString(name.c_str(), &string_value)) { |
| 105 store->Apply( | 105 store->Apply( |
| 106 current->policy_type, | 106 current->policy_type, |
| 107 Value::CreateStringValueFromUTF16(string_value)); | 107 Value::CreateStringValue(string_value)); |
| 108 } | 108 } |
| 109 break; | 109 break; |
| 110 case Value::TYPE_BOOLEAN: | 110 case Value::TYPE_BOOLEAN: |
| 111 if (GetRegistryPolicyBoolean(name.c_str(), &bool_value)) { | 111 if (GetRegistryPolicyBoolean(name.c_str(), &bool_value)) { |
| 112 store->Apply(current->policy_type, | 112 store->Apply(current->policy_type, |
| 113 Value::CreateBooleanValue(bool_value)); | 113 Value::CreateBooleanValue(bool_value)); |
| 114 } | 114 } |
| 115 break; | 115 break; |
| 116 case Value::TYPE_INTEGER: | 116 case Value::TYPE_INTEGER: |
| 117 if (GetRegistryPolicyInteger(name.c_str(), &int_value)) { | 117 if (GetRegistryPolicyInteger(name.c_str(), &int_value)) { |
| 118 store->Apply(current->policy_type, | 118 store->Apply(current->policy_type, |
| 119 Value::CreateIntegerValue(int_value)); | 119 Value::CreateIntegerValue(int_value)); |
| 120 } | 120 } |
| 121 break; | 121 break; |
| 122 default: | 122 default: |
| 123 NOTREACHED(); | 123 NOTREACHED(); |
| 124 return false; | 124 return false; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 return true; | 128 return true; |
| 129 } | 129 } |
| OLD | NEW |