| 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_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 <string> | 9 #include <string> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // ConfigurationPolicyStore methods: | 35 // ConfigurationPolicyStore methods: |
| 36 virtual void Apply(PolicyType setting, Value* value); | 36 virtual void Apply(PolicyType setting, Value* value); |
| 37 | 37 |
| 38 // Creates a ConfigurationPolicyPrefStore that reads managed policy. | 38 // Creates a ConfigurationPolicyPrefStore that reads managed policy. |
| 39 static ConfigurationPolicyPrefStore* CreateManagedPolicyPrefStore(); | 39 static ConfigurationPolicyPrefStore* CreateManagedPolicyPrefStore(); |
| 40 | 40 |
| 41 // Creates a ConfigurationPolicyPrefStore that reads recommended policy. | 41 // Creates a ConfigurationPolicyPrefStore that reads recommended policy. |
| 42 static ConfigurationPolicyPrefStore* CreateRecommendedPolicyPrefStore(); | 42 static ConfigurationPolicyPrefStore* CreateRecommendedPolicyPrefStore(); |
| 43 | 43 |
| 44 // Returns the default policy value map for Chrome. | 44 // Returns the default policy definition list for Chrome. |
| 45 static ConfigurationPolicyProvider::StaticPolicyValueMap | 45 static ConfigurationPolicyProvider::PolicyDefinitionList* |
| 46 GetChromePolicyValueMap(); | 46 GetChromePolicyDefinitionList(); |
| 47 | 47 |
| 48 typedef std::set<const char*> ProxyPreferenceSet; | 48 typedef std::set<const char*> ProxyPreferenceSet; |
| 49 | 49 |
| 50 // Returns the set of preference paths that can be affected by a proxy | 50 // Returns the set of preference paths that can be affected by a proxy |
| 51 // policy. | 51 // policy. |
| 52 static void GetProxyPreferenceSet(ProxyPreferenceSet* proxy_pref_set); | 52 static void GetProxyPreferenceSet(ProxyPreferenceSet* proxy_pref_set); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 // Policies that map to a single preference are handled | 55 // Policies that map to a single preference are handled |
| 56 // by an automated converter. Each one of these policies | 56 // by an automated converter. Each one of these policies |
| 57 // has an entry in |simple_policy_map_| with the following type. | 57 // has an entry in |simple_policy_map_| with the following type. |
| 58 struct PolicyToPreferenceMapEntry { | 58 struct PolicyToPreferenceMapEntry { |
| 59 Value::ValueType value_type; | 59 Value::ValueType value_type; |
| 60 PolicyType policy_type; | 60 PolicyType policy_type; |
| 61 const char* preference_path; // A DictionaryValue path, not a file path. | 61 const char* preference_path; // A DictionaryValue path, not a file path. |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 static const PolicyToPreferenceMapEntry simple_policy_map_[]; | 64 static const PolicyToPreferenceMapEntry simple_policy_map_[]; |
| 65 static const PolicyToPreferenceMapEntry proxy_policy_map_[]; | 65 static const PolicyToPreferenceMapEntry proxy_policy_map_[]; |
| 66 static const PolicyToPreferenceMapEntry default_search_policy_map_[]; | 66 static const PolicyToPreferenceMapEntry default_search_policy_map_[]; |
| 67 static const ConfigurationPolicyProvider::StaticPolicyValueMap | 67 static const ConfigurationPolicyProvider::PolicyDefinitionList |
| 68 policy_value_map_; | 68 policy_definition_list_; |
| 69 | 69 |
| 70 ConfigurationPolicyProvider* provider_; | 70 ConfigurationPolicyProvider* provider_; |
| 71 scoped_ptr<DictionaryValue> prefs_; | 71 scoped_ptr<DictionaryValue> prefs_; |
| 72 | 72 |
| 73 // Set to false until the first proxy-relevant policy is applied. At that | 73 // Set to false until the first proxy-relevant policy is applied. At that |
| 74 // time, default values are provided for all proxy-relevant prefs | 74 // time, default values are provided for all proxy-relevant prefs |
| 75 // to override any values set from stores with a lower priority. | 75 // to override any values set from stores with a lower priority. |
| 76 bool lower_priority_proxy_settings_overridden_; | 76 bool lower_priority_proxy_settings_overridden_; |
| 77 | 77 |
| 78 // The following are used to track what proxy-relevant policy has been applied | 78 // The following are used to track what proxy-relevant policy has been applied |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // unspecified map entries. Otherwise wipes all default search related | 122 // unspecified map entries. Otherwise wipes all default search related |
| 123 // map entries from |prefs_|. | 123 // map entries from |prefs_|. |
| 124 void FinalizeDefaultSearchPolicySettings(); | 124 void FinalizeDefaultSearchPolicySettings(); |
| 125 | 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); | 126 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace policy | 129 } // namespace policy |
| 130 | 130 |
| 131 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ | 131 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ |
| OLD | NEW |