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

Unified Diff: components/policy/core/common/registry_dict.h

Issue 2481753002: Push preg_parser and registry_dict changes upstream (Closed)
Patch Set: Minor formatting fixes Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/registry_dict.h
diff --git a/components/policy/core/common/registry_dict_win.h b/components/policy/core/common/registry_dict.h
similarity index 90%
rename from components/policy/core/common/registry_dict_win.h
rename to components/policy/core/common/registry_dict.h
index a5065ed7233603474899c506a5f551a787113db1..ca3b901896fb1c4d13a93b84bebd2617d700a8c4 100644
--- a/components/policy/core/common/registry_dict_win.h
+++ b/components/policy/core/common/registry_dict.h
@@ -2,10 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_
-#define COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_
-
-#include <windows.h>
+#ifndef COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_H_
+#define COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_H_
#include <map>
#include <memory>
@@ -15,14 +13,16 @@
#include "base/strings/string16.h"
#include "components/policy/policy_export.h"
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
namespace base {
class Value;
}
namespace policy {
-class Schema;
-
// A case-insensitive string comparison functor.
struct POLICY_EXPORT CaseInsensitiveStringCompare {
bool operator()(const std::string& a, const std::string& b) const;
@@ -69,6 +69,7 @@ class POLICY_EXPORT RegistryDict {
// Swap with |other|.
void Swap(RegistryDict* other);
+#if defined(OS_WIN)
// Read a Windows registry subtree into this registry dictionary object.
void ReadRegistry(HKEY hive, const base::string16& root);
@@ -76,7 +77,8 @@ class POLICY_EXPORT RegistryDict {
// collisions, the key wins. |schema| is used to determine the expected type
// for each policy.
// The returned object is either a base::DictionaryValue or a base::ListValue.
- std::unique_ptr<base::Value> ConvertToJSON(const Schema& schema) const;
+ std::unique_ptr<base::Value> ConvertToJSON(const class Schema& schema) const;
+#endif
const KeyMap& keys() const { return keys_; }
const ValueMap& values() const { return values_; }
@@ -90,4 +92,4 @@ class POLICY_EXPORT RegistryDict {
} // namespace policy
-#endif // COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_WIN_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_H_
« no previous file with comments | « components/policy/core/common/preg_parser_win_unittest.cc ('k') | components/policy/core/common/registry_dict.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698