OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CONFIGURATION_POLICY_PREF_STORE_H_ | 5 #ifndef CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_ |
6 #define CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_ | 6 #define CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // The ConfigurationPolicyPrefStore takes the ownership of the passed | 25 // The ConfigurationPolicyPrefStore takes the ownership of the passed |
26 // |provider|. | 26 // |provider|. |
27 ConfigurationPolicyPrefStore(const CommandLine* command_line, | 27 ConfigurationPolicyPrefStore(const CommandLine* command_line, |
28 ConfigurationPolicyProvider* provider); | 28 ConfigurationPolicyProvider* provider); |
29 virtual ~ConfigurationPolicyPrefStore() { } | 29 virtual ~ConfigurationPolicyPrefStore() { } |
30 | 30 |
31 // PrefStore methods: | 31 // PrefStore methods: |
32 virtual PrefReadError ReadPrefs(); | 32 virtual PrefReadError ReadPrefs(); |
33 virtual DictionaryValue* prefs() { return prefs_.get(); } | 33 virtual DictionaryValue* prefs() { return prefs_.get(); } |
34 | 34 |
| 35 // Creates a ConfigurationPolicyPrefStore that reads managed policy. |
| 36 static ConfigurationPolicyPrefStore* CreateManagedPolicyPrefStore(); |
| 37 |
| 38 // Creates a ConfigurationPolicyPrefStore that reads recommended policy. |
| 39 static ConfigurationPolicyPrefStore* CreateRecommendedPolicyPrefStore(); |
| 40 |
35 private: | 41 private: |
36 // For unit tests. | 42 // For unit tests. |
37 friend class ConfigurationPolicyPrefStoreTest; | 43 friend class ConfigurationPolicyPrefStoreTest; |
38 | 44 |
39 // Policies that map to a single preference are handled | 45 // Policies that map to a single preference are handled |
40 // by an automated converter. Each one of these policies | 46 // by an automated converter. Each one of these policies |
41 // has an entry in |simple_policy_map_| with the following type. | 47 // has an entry in |simple_policy_map_| with the following type. |
42 struct PolicyToPreferenceMapEntry { | 48 struct PolicyToPreferenceMapEntry { |
43 Value::ValueType value_type; | 49 Value::ValueType value_type; |
44 PolicyType policy_type; | 50 PolicyType policy_type; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bool ApplyPluginPolicy(PolicyType policy, Value* value); | 97 bool ApplyPluginPolicy(PolicyType policy, Value* value); |
92 | 98 |
93 // Handles sync-related policies. Returns true if the policy was handled. | 99 // Handles sync-related policies. Returns true if the policy was handled. |
94 // Assumes ownership of |value| in that case. | 100 // Assumes ownership of |value| in that case. |
95 bool ApplySyncPolicy(PolicyType policy, Value* value); | 101 bool ApplySyncPolicy(PolicyType policy, Value* value); |
96 | 102 |
97 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); | 103 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); |
98 }; | 104 }; |
99 | 105 |
100 #endif // CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_ | 106 #endif // CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_ |
OLD | NEW |