Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: chrome/browser/policy/registry_dict_win.h

Issue 22645011: policy: use JSON schema to deserialize entries from Windows registry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 3rd party policy unit tests Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_loader_win_unittest.cc ('k') | chrome/browser/policy/registry_dict_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698