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

Unified Diff: chrome/browser/config_dir_policy_provider.h

Issue 2027010: Preference provider implementation backed by JSON files in a directory. (Closed)
Patch Set: A few more fixes. Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/config_dir_policy_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/config_dir_policy_provider.h
diff --git a/chrome/browser/config_dir_policy_provider.h b/chrome/browser/config_dir_policy_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..05bffd0b9784d5b2b8a2c637bebe4ce71708384a
--- /dev/null
+++ b/chrome/browser/config_dir_policy_provider.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CONFIG_DIR_POLICY_PROVIDER_H_
+#define CHROME_BROWSER_CONFIG_DIR_POLICY_PROVIDER_H_
+
+#include "base/basictypes.h"
+#include "base/file_path.h"
+#include "chrome/browser/configuration_policy_provider.h"
+
+class DictionaryValue;
+
+// A policy provider implementation backed by a set of files in a given
+// directory. The files should contain JSON-formatted policy settings. They are
+// merged together and the result is returned via the
+// ConfigurationPolicyProvider interface. The files are consulted in
+// lexicographic file name order, so the last value read takes precedence in
+// case of preference key collisions.
+class ConfigDirPolicyProvider : public ConfigurationPolicyProvider {
+ public:
+ explicit ConfigDirPolicyProvider(const FilePath& config_dir);
+ virtual ~ConfigDirPolicyProvider() { }
+
+ // ConfigurationPolicyProvider implementation.
+ virtual bool Provide(ConfigurationPolicyStore* store);
+
+ private:
+ // Read and merge the files from the configuration directory.
+ DictionaryValue* ReadPolicies();
+
+ // The directory in which we look for configuration files.
+ const FilePath config_dir_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyProvider);
+};
+
+#endif // CHROME_BROWSER_CONFIG_DIR_POLICY_PROVIDER_H_
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/config_dir_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698