| 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 CHROME_BROWSER_POLICY_REGISTRY_DICT_WIN_H_ | 5 #ifndef CHROME_BROWSER_POLICY_REGISTRY_DICT_WIN_H_ |
| 6 #define CHROME_BROWSER_POLICY_REGISTRY_DICT_WIN_H_ | 6 #define CHROME_BROWSER_POLICY_REGISTRY_DICT_WIN_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "components/policy/core/common/policy_schema.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class DictionaryValue; | 19 class DictionaryValue; |
| 19 class Value; | 20 class Value; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace policy { | 23 namespace policy { |
| 23 | 24 |
| 24 // A case-insensitive string comparison functor. | 25 // A case-insensitive string comparison functor. |
| 25 struct CaseInsensitiveStringCompare { | 26 struct CaseInsensitiveStringCompare { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Swap with |other|. | 66 // Swap with |other|. |
| 66 void Swap(RegistryDict* other); | 67 void Swap(RegistryDict* other); |
| 67 | 68 |
| 68 // Read a Windows registry subtree into this registry dictionary object. | 69 // Read a Windows registry subtree into this registry dictionary object. |
| 69 void ReadRegistry(HKEY hive, const string16& root); | 70 void ReadRegistry(HKEY hive, const string16& root); |
| 70 | 71 |
| 71 // Converts the dictionary to base::Value representation. For key/value name | 72 // Converts the dictionary to base::Value representation. For key/value name |
| 72 // collisions, the key wins. |schema| supplies an optional JSON schema that | 73 // collisions, the key wins. |schema| supplies an optional JSON schema that |
| 73 // 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 |
| 74 // either a base::DictionaryValue or a base::ListValue. | 75 // either a base::DictionaryValue or a base::ListValue. |
| 75 scoped_ptr<base::Value> ConvertToJSON( | 76 scoped_ptr<base::Value> ConvertToJSON(const PolicySchema* schema) const; |
| 76 const base::DictionaryValue* schema) const; | |
| 77 | 77 |
| 78 const KeyMap& keys() const { return keys_; } | 78 const KeyMap& keys() const { return keys_; } |
| 79 const ValueMap& values() const { return values_; } | 79 const ValueMap& values() const { return values_; } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 KeyMap keys_; | 82 KeyMap keys_; |
| 83 ValueMap values_; | 83 ValueMap values_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(RegistryDict); | 85 DISALLOW_COPY_AND_ASSIGN(RegistryDict); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace policy | 88 } // namespace policy |
| 89 | 89 |
| 90 #endif // CHROME_BROWSER_POLICY_REGISTRY_DICT_WIN_H_ | 90 #endif // CHROME_BROWSER_POLICY_REGISTRY_DICT_WIN_H_ |
| OLD | NEW |