Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_MANAGED_MODE_POLICY_PROVIDER_H_ | |
| 6 #define CHROME_BROWSER_POLICY_MANAGED_MODE_POLICY_PROVIDER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "chrome/browser/policy/configuration_policy_provider.h" | |
| 11 #include "chrome/browser/profiles/profile_keyed_service.h" | |
| 12 #include "chrome/common/persistent_pref_store.h" | |
| 13 | |
| 14 class Profile; | |
| 15 | |
| 16 namespace policy { | |
| 17 | |
|
Mattias Nissler (ping if slow)
2012/06/06 17:22:09
Please put a comment describing what this class is
Bernhard Bauer
2012/06/08 10:06:44
Done.
| |
| 18 class ManagedModePolicyProvider | |
|
Joao da Silva
2012/06/06 16:36:38
Please keep the declaration order in the .h and th
Bernhard Bauer
2012/06/08 10:06:44
Done.
| |
| 19 : public ProfileKeyedService, | |
| 20 public ConfigurationPolicyProvider, | |
| 21 public PrefStore::Observer { | |
| 22 public: | |
| 23 explicit ManagedModePolicyProvider(Profile* profile); | |
| 24 virtual ~ManagedModePolicyProvider(); | |
| 25 | |
| 26 // Returns the stored value for a policy with the given |key|, or NULL if no | |
| 27 // such policy is defined. | |
| 28 const base::Value* GetPolicy(const std::string& key) const; | |
| 29 // Sets the policy with the given |key| to a copy of the given |value|. | |
| 30 void SetPolicy(const std::string& key, const base::Value* value); | |
| 31 | |
| 32 // ConfigurationPolicyProvider implementation: | |
| 33 virtual void RefreshPolicies() OVERRIDE; | |
| 34 virtual bool IsInitializationComplete() const OVERRIDE; | |
| 35 | |
| 36 // PrefStore::Observer implementation: | |
| 37 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE; | |
| 38 virtual void OnInitializationCompleted(bool success) OVERRIDE; | |
| 39 | |
| 40 private: | |
| 41 base::DictionaryValue* GetPolicyDictionary() const; | |
| 42 void UpdatePolicies(); | |
| 43 | |
|
Mattias Nissler (ping if slow)
2012/06/06 17:22:09
Put a comment explaining that this is used for per
Bernhard Bauer
2012/06/08 10:06:44
Done.
| |
| 44 scoped_refptr<PersistentPrefStore> store_; | |
| 45 }; | |
| 46 | |
| 47 } // namespace policy | |
| 48 | |
| 49 #endif // CHROME_BROWSER_POLICY_MANAGED_MODE_POLICY_PROVIDER_H_ | |
| OLD | NEW |