OLD | NEW |
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 10 matching lines...) Expand all Loading... |
42 const Value** result) const; | 40 const Value** result) const; |
43 | 41 |
44 // ConfigurationPolicyProvider::Observer methods: | 42 // ConfigurationPolicyProvider::Observer methods: |
45 virtual void OnUpdatePolicy(); | 43 virtual void OnUpdatePolicy(); |
46 virtual void OnProviderGoingAway(); | 44 virtual void OnProviderGoingAway(); |
47 | 45 |
48 // Creates a ConfigurationPolicyPrefStore that reads managed platform policy. | 46 // Creates a ConfigurationPolicyPrefStore that reads managed platform policy. |
49 static ConfigurationPolicyPrefStore* CreateManagedPlatformPolicyPrefStore(); | 47 static ConfigurationPolicyPrefStore* CreateManagedPlatformPolicyPrefStore(); |
50 | 48 |
51 // Creates a ConfigurationPolicyPrefStore that reads managed cloud policy. | 49 // Creates a ConfigurationPolicyPrefStore that reads managed cloud policy. |
52 static ConfigurationPolicyPrefStore* CreateManagedCloudPolicyPrefStore( | 50 static ConfigurationPolicyPrefStore* CreateManagedCloudPolicyPrefStore(); |
53 Profile* profile); | |
54 | 51 |
55 // Creates a ConfigurationPolicyPrefStore that reads recommended platform | 52 // Creates a ConfigurationPolicyPrefStore that reads recommended platform |
56 // policy. | 53 // policy. |
57 static ConfigurationPolicyPrefStore* | 54 static ConfigurationPolicyPrefStore* |
58 CreateRecommendedPlatformPolicyPrefStore(); | 55 CreateRecommendedPlatformPolicyPrefStore(); |
59 | 56 |
60 // Creates a ConfigurationPolicyPrefStore that reads recommended cloud policy. | 57 // Creates a ConfigurationPolicyPrefStore that reads recommended cloud policy. |
61 static ConfigurationPolicyPrefStore* CreateRecommendedCloudPolicyPrefStore( | 58 static ConfigurationPolicyPrefStore* CreateRecommendedCloudPolicyPrefStore(); |
62 Profile* profile); | |
63 | 59 |
64 // Returns the default policy definition list for Chrome. | 60 // Returns the default policy definition list for Chrome. |
65 static const ConfigurationPolicyProvider::PolicyDefinitionList* | 61 static const ConfigurationPolicyProvider::PolicyDefinitionList* |
66 GetChromePolicyDefinitionList(); | 62 GetChromePolicyDefinitionList(); |
67 | 63 |
68 private: | 64 private: |
69 // Refreshes policy information, rereading policy from the provider and | 65 // Refreshes policy information, rereading policy from the provider and |
70 // sending out change notifications as appropriate. | 66 // sending out change notifications as appropriate. |
71 void Refresh(); | 67 void Refresh(); |
72 | 68 |
(...skipping 13 matching lines...) Expand all Loading... |
86 ObserverList<PrefStore::Observer, true> observers_; | 82 ObserverList<PrefStore::Observer, true> observers_; |
87 | 83 |
88 ConfigurationPolicyObserverRegistrar registrar_; | 84 ConfigurationPolicyObserverRegistrar registrar_; |
89 | 85 |
90 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); | 86 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); |
91 }; | 87 }; |
92 | 88 |
93 } // namespace policy | 89 } // namespace policy |
94 | 90 |
95 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ | 91 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ |
OLD | NEW |