summaryrefslogtreecommitdiffstats
path: root/chrome/browser/configuration_policy_provider.h
blob: aedc4e713e948e46d597df03842c3760b8b54753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// 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_CONFIGURATION_POLICY_PROVIDER_H_
#define CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_

#include "base/basictypes.h"

class ConfigurationPolicyStore;
class DictionaryValue;

// An abstract super class for platform-specific policy providers.
// Platform-specific policy providers (Windows Group Policy, gconf,
// etc.) should implement a subclass of this class.
class ConfigurationPolicyProvider {
 public:
  ConfigurationPolicyProvider() {}
  virtual ~ConfigurationPolicyProvider() {}

  // Must be implemented by provider subclasses to specify the
  // provider-specific policy decisions. The preference service
  // invokes this |Provide| method when it needs a policy
  // provider to specify its policy choices. In |Provide|,
  // the |ConfigurationPolicyProvider| must make calls to the
  // |Apply| method of |store| to apply specific policies.
  // Returns true if the policy could be provided, otherwise false.
  virtual bool Provide(ConfigurationPolicyStore* store) = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProvider);
};

// Base functionality for all policy providers that use a DictionaryValue tree
// structure holding key-value pairs for storing policy settings. Decodes the
// value tree and writes the configuration to the given |store|.
void DecodePolicyValueTree(DictionaryValue* policies,
                           ConfigurationPolicyStore* store);

#endif  // CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_