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

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

Issue 10510006: Add ManagedModePolicyProvider and extension API to get and set policies. (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
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_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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698