• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_PROVIDER_H_
6 #define CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_PROVIDER_H_
7 #pragma once
8 
9 #include "chrome/browser/policy/file_based_policy_provider.h"
10 
11 namespace policy {
12 
13 // Policy provider backed by JSON files in a configuration directory.
14 class ConfigDirPolicyProvider : public FileBasedPolicyProvider {
15  public:
16   ConfigDirPolicyProvider(
17       const ConfigurationPolicyProvider::PolicyDefinitionList* policy_list,
18       const FilePath& config_dir);
19 
20  private:
21   DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyProvider);
22 };
23 
24 // A provider delegate implementation backed by a set of files in a given
25 // directory. The files should contain JSON-formatted policy settings. They are
26 // merged together and the result is returned via the ProviderDelegate
27 // interface. The files are consulted in lexicographic file name order, so the
28 // last value read takes precedence in case of preference key collisions.
29 class ConfigDirPolicyProviderDelegate
30     : public FileBasedPolicyProvider::ProviderDelegate {
31  public:
32   explicit ConfigDirPolicyProviderDelegate(const FilePath& config_dir);
33 
34   // FileBasedPolicyProvider::ProviderDelegate implementation.
35   virtual DictionaryValue* Load();
36   virtual base::Time GetLastModification();
37 
38  private:
39   DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyProviderDelegate);
40 };
41 
42 }  // namespace policy
43 
44 #endif  // CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_PROVIDER_H_
45