| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/policy/core/common/registry_dict_win.h" | 5 #include "components/policy/core/common/registry_dict_win.h" |
| 6 | 6 |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 entry != other.values_.end(); ++entry) { | 288 entry != other.values_.end(); ++entry) { |
| 289 SetValue(entry->first, make_scoped_ptr(entry->second->DeepCopy())); | 289 SetValue(entry->first, make_scoped_ptr(entry->second->DeepCopy())); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 void RegistryDict::Swap(RegistryDict* other) { | 293 void RegistryDict::Swap(RegistryDict* other) { |
| 294 keys_.swap(other->keys_); | 294 keys_.swap(other->keys_); |
| 295 values_.swap(other->values_); | 295 values_.swap(other->values_); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void RegistryDict::ReadRegistry(HKEY hive, const string16& root) { | 298 void RegistryDict::ReadRegistry(HKEY hive, const base::string16& root) { |
| 299 ClearKeys(); | 299 ClearKeys(); |
| 300 ClearValues(); | 300 ClearValues(); |
| 301 | 301 |
| 302 // First, read all the values of the key. | 302 // First, read all the values of the key. |
| 303 for (RegistryValueIterator it(hive, root.c_str()); it.Valid(); ++it) { | 303 for (RegistryValueIterator it(hive, root.c_str()); it.Valid(); ++it) { |
| 304 const std::string name = UTF16ToUTF8(it.Name()); | 304 const std::string name = UTF16ToUTF8(it.Name()); |
| 305 switch (it.Type()) { | 305 switch (it.Type()) { |
| 306 case REG_SZ: | 306 case REG_SZ: |
| 307 case REG_EXPAND_SZ: | 307 case REG_EXPAND_SZ: |
| 308 SetValue( | 308 SetValue( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 return result.Pass(); | 391 return result.Pass(); |
| 392 } | 392 } |
| 393 default: | 393 default: |
| 394 LOG(WARNING) << "Can't convert registry key to schema type " << type; | 394 LOG(WARNING) << "Can't convert registry key to schema type " << type; |
| 395 } | 395 } |
| 396 | 396 |
| 397 return make_scoped_ptr(base::Value::CreateNullValue()); | 397 return make_scoped_ptr(base::Value::CreateNullValue()); |
| 398 } | 398 } |
| 399 | 399 |
| 400 } // namespace policy | 400 } // namespace policy |
| OLD | NEW |