| 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 #ifndef COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Clears all values. | 60 // Clears all values. |
| 61 void ClearValues(); | 61 void ClearValues(); |
| 62 | 62 |
| 63 // Merge keys and values from |other|, giving precedence to |other|. | 63 // Merge keys and values from |other|, giving precedence to |other|. |
| 64 void Merge(const RegistryDict& other); | 64 void Merge(const RegistryDict& other); |
| 65 | 65 |
| 66 // Swap with |other|. | 66 // Swap with |other|. |
| 67 void Swap(RegistryDict* other); | 67 void Swap(RegistryDict* other); |
| 68 | 68 |
| 69 // Read a Windows registry subtree into this registry dictionary object. | 69 // Read a Windows registry subtree into this registry dictionary object. |
| 70 void ReadRegistry(HKEY hive, const string16& root); | 70 void ReadRegistry(HKEY hive, const base::string16& root); |
| 71 | 71 |
| 72 // Converts the dictionary to base::Value representation. For key/value name | 72 // Converts the dictionary to base::Value representation. For key/value name |
| 73 // collisions, the key wins. |schema| supplies an optional JSON schema that | 73 // collisions, the key wins. |schema| supplies an optional JSON schema that |
| 74 // will be used to map types to base::Value types. The returned object is | 74 // will be used to map types to base::Value types. The returned object is |
| 75 // either a base::DictionaryValue or a base::ListValue. | 75 // either a base::DictionaryValue or a base::ListValue. |
| 76 scoped_ptr<base::Value> ConvertToJSON( | 76 scoped_ptr<base::Value> ConvertToJSON( |
| 77 const base::DictionaryValue* schema) const; | 77 const base::DictionaryValue* schema) const; |
| 78 | 78 |
| 79 const KeyMap& keys() const { return keys_; } | 79 const KeyMap& keys() const { return keys_; } |
| 80 const ValueMap& values() const { return values_; } | 80 const ValueMap& values() const { return values_; } |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 KeyMap keys_; | 83 KeyMap keys_; |
| 84 ValueMap values_; | 84 ValueMap values_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(RegistryDict); | 86 DISALLOW_COPY_AND_ASSIGN(RegistryDict); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace policy | 89 } // namespace policy |
| 90 | 90 |
| 91 #endif // COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_ | 91 #endif // COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_ |
| OLD | NEW |