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

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

Issue 7147015: Move user cloud policy to BrowserProcess (was 6979011) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit_test include breakage Created 9 years, 5 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/policy/configuration_policy_provider.h" 16 #include "chrome/browser/policy/configuration_policy_provider.h"
17 #include "chrome/browser/policy/configuration_policy_store_interface.h" 17 #include "chrome/browser/policy/configuration_policy_store_interface.h"
18 #include "chrome/common/pref_store.h" 18 #include "chrome/common/pref_store.h"
19 19
20 class Profile;
21
22 namespace policy { 20 namespace policy {
23 21
24 class ConfigurationPolicyPrefKeeper; 22 class ConfigurationPolicyPrefKeeper;
25 23
26 // An implementation of PrefStore that bridges policy settings as read from a 24 // An implementation of PrefStore that bridges policy settings as read from a
27 // ConfigurationPolicyProvider to preferences. 25 // ConfigurationPolicyProvider to preferences.
28 class ConfigurationPolicyPrefStore 26 class ConfigurationPolicyPrefStore
29 : public PrefStore, 27 : public PrefStore,
30 public ConfigurationPolicyProvider::Observer { 28 public ConfigurationPolicyProvider::Observer {
31 public: 29 public:
(...skipping 11 matching lines...) Expand all
43 const Value** result) const; 41 const Value** result) const;
44 42
45 // ConfigurationPolicyProvider::Observer methods: 43 // ConfigurationPolicyProvider::Observer methods:
46 virtual void OnUpdatePolicy(); 44 virtual void OnUpdatePolicy();
47 virtual void OnProviderGoingAway(); 45 virtual void OnProviderGoingAway();
48 46
49 // Creates a ConfigurationPolicyPrefStore that reads managed platform policy. 47 // Creates a ConfigurationPolicyPrefStore that reads managed platform policy.
50 static ConfigurationPolicyPrefStore* CreateManagedPlatformPolicyPrefStore(); 48 static ConfigurationPolicyPrefStore* CreateManagedPlatformPolicyPrefStore();
51 49
52 // Creates a ConfigurationPolicyPrefStore that reads managed cloud policy. 50 // Creates a ConfigurationPolicyPrefStore that reads managed cloud policy.
53 static ConfigurationPolicyPrefStore* CreateManagedCloudPolicyPrefStore( 51 static ConfigurationPolicyPrefStore* CreateManagedCloudPolicyPrefStore();
54 Profile* profile);
55 52
56 // Creates a ConfigurationPolicyPrefStore that reads recommended platform 53 // Creates a ConfigurationPolicyPrefStore that reads recommended platform
57 // policy. 54 // policy.
58 static ConfigurationPolicyPrefStore* 55 static ConfigurationPolicyPrefStore*
59 CreateRecommendedPlatformPolicyPrefStore(); 56 CreateRecommendedPlatformPolicyPrefStore();
60 57
61 // Creates a ConfigurationPolicyPrefStore that reads recommended cloud policy. 58 // Creates a ConfigurationPolicyPrefStore that reads recommended cloud policy.
62 static ConfigurationPolicyPrefStore* CreateRecommendedCloudPolicyPrefStore( 59 static ConfigurationPolicyPrefStore* CreateRecommendedCloudPolicyPrefStore();
63 Profile* profile);
64 60
65 // Returns the default policy definition list for Chrome. 61 // Returns the default policy definition list for Chrome.
66 static const ConfigurationPolicyProvider::PolicyDefinitionList* 62 static const ConfigurationPolicyProvider::PolicyDefinitionList*
67 GetChromePolicyDefinitionList(); 63 GetChromePolicyDefinitionList();
68 64
65 // Returns true if the given policy is a proxy policy.
66 static bool IsProxyPolicy(ConfigurationPolicyType policy);
67
69 private: 68 private:
70 explicit ConfigurationPolicyPrefStore(ConfigurationPolicyProvider* provider); 69 explicit ConfigurationPolicyPrefStore(ConfigurationPolicyProvider* provider);
71 70
72 // Refreshes policy information, rereading policy from the provider and 71 // Refreshes policy information, rereading policy from the provider and
73 // sending out change notifications as appropriate. 72 // sending out change notifications as appropriate.
74 void Refresh(); 73 void Refresh();
75 74
76 static const ConfigurationPolicyProvider::PolicyDefinitionList 75 static const ConfigurationPolicyProvider::PolicyDefinitionList
77 kPolicyDefinitionList; 76 kPolicyDefinitionList;
78 77
(...skipping 10 matching lines...) Expand all
89 ObserverList<PrefStore::Observer, true> observers_; 88 ObserverList<PrefStore::Observer, true> observers_;
90 89
91 ConfigurationPolicyObserverRegistrar registrar_; 90 ConfigurationPolicyObserverRegistrar registrar_;
92 91
93 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); 92 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore);
94 }; 93 };
95 94
96 } // namespace policy 95 } // namespace policy
97 96
98 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ 97 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud_policy_subsystem_unittest.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698