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

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

Issue 10443108: Implement the ConfigDirPolicyProvider based on the AsyncPolicyLoader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/policy/config_dir_policy_loader_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 "base/time.h"
10 #include "chrome/browser/policy/file_based_policy_provider.h"
11
12 class FilePath;
13
14 namespace base {
15 class Value;
16 }
17
18 namespace policy {
19
20 class PolicyBundle;
21
22 // Policy provider backed by JSON files in a configuration directory.
23 class ConfigDirPolicyProvider : public FileBasedPolicyProvider {
24 public:
25 ConfigDirPolicyProvider(const PolicyDefinitionList* policy_list,
26 PolicyLevel level,
27 PolicyScope scope,
28 const FilePath& config_dir);
29
30 private:
31 DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyProvider);
32 };
33
34 // A provider delegate implementation backed by a set of files in a given
35 // directory. The files should contain JSON-formatted policy settings. They are
36 // merged together and the result is returned via the ProviderDelegate
37 // interface. The files are consulted in lexicographic file name order, so the
38 // last value read takes precedence in case of preference key collisions.
39 class ConfigDirPolicyProviderDelegate
40 : public FileBasedPolicyProvider::ProviderDelegate {
41 public:
42 ConfigDirPolicyProviderDelegate(const FilePath& config_dir,
43 PolicyLevel level,
44 PolicyScope scope);
45
46 // FileBasedPolicyProvider::ProviderDelegate implementation.
47 virtual scoped_ptr<PolicyBundle> Load() OVERRIDE;
48 virtual base::Time GetLastModification() OVERRIDE;
49
50 private:
51 // Merges the 3rd party |policies| into the |bundle|.
52 void Merge3rdPartyPolicy(PolicyBundle* bundle,
53 const base::Value* policies);
54
55 // Policies loaded by this provider will have these attributes.
56 PolicyLevel level_;
57 PolicyScope scope_;
58
59 DISALLOW_COPY_AND_ASSIGN(ConfigDirPolicyProviderDelegate);
60 };
61
62 } // namespace policy
63
64 #endif // CHROME_BROWSER_POLICY_CONFIG_DIR_POLICY_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/config_dir_policy_loader_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698