| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 // This provides a way to access the application's current preferences. | 5 // This provides a way to access the application's current preferences. |
| 6 | 6 |
| 7 // Chromium settings and storage represent user-selected preferences and | 7 // Chromium settings and storage represent user-selected preferences and |
| 8 // information and MUST not be extracted, overwritten or modified except | 8 // information and MUST not be extracted, overwritten or modified except |
| 9 // through Chromium defined APIs. | 9 // through Chromium defined APIs. |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 const base::Value* GetValue() const; | 81 const base::Value* GetValue() const; |
| 82 | 82 |
| 83 // Returns the value recommended by the admin, if any. | 83 // Returns the value recommended by the admin, if any. |
| 84 const base::Value* GetRecommendedValue() const; | 84 const base::Value* GetRecommendedValue() const; |
| 85 | 85 |
| 86 // Returns true if the Preference is managed, i.e. set by an admin policy. | 86 // Returns true if the Preference is managed, i.e. set by an admin policy. |
| 87 // Since managed prefs have the highest priority, this also indicates | 87 // Since managed prefs have the highest priority, this also indicates |
| 88 // whether the pref is actually being controlled by the policy setting. | 88 // whether the pref is actually being controlled by the policy setting. |
| 89 bool IsManaged() const; | 89 bool IsManaged() const; |
| 90 | 90 |
| 91 // Returns true if the Preference is controlled by the custodian of the |
| 92 // supervised user. Since a supervised user is not expected to have an admin |
| 93 // policy, this is the controlling pref if set. |
| 94 bool IsManagedByCustodian() const; |
| 95 |
| 91 // Returns true if the Preference is recommended, i.e. set by an admin | 96 // Returns true if the Preference is recommended, i.e. set by an admin |
| 92 // policy but the user is allowed to change it. | 97 // policy but the user is allowed to change it. |
| 93 bool IsRecommended() const; | 98 bool IsRecommended() const; |
| 94 | 99 |
| 95 // Returns true if the Preference has a value set by an extension, even if | 100 // Returns true if the Preference has a value set by an extension, even if |
| 96 // that value is being overridden by a higher-priority source. | 101 // that value is being overridden by a higher-priority source. |
| 97 bool HasExtensionSetting() const; | 102 bool HasExtensionSetting() const; |
| 98 | 103 |
| 99 // Returns true if the Preference has a user setting, even if that value is | 104 // Returns true if the Preference has a user setting, even if that value is |
| 100 // being overridden by a higher-priority source. | 105 // being overridden by a higher-priority source. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 virtual ~PrefService(); | 156 virtual ~PrefService(); |
| 152 | 157 |
| 153 // Lands pending writes to disk. This should only be used if we need to save | 158 // Lands pending writes to disk. This should only be used if we need to save |
| 154 // immediately (basically, during shutdown). | 159 // immediately (basically, during shutdown). |
| 155 void CommitPendingWrite(); | 160 void CommitPendingWrite(); |
| 156 | 161 |
| 157 // Returns true if the preference for the given preference name is available | 162 // Returns true if the preference for the given preference name is available |
| 158 // and is managed. | 163 // and is managed. |
| 159 bool IsManagedPreference(const std::string& pref_name) const; | 164 bool IsManagedPreference(const std::string& pref_name) const; |
| 160 | 165 |
| 166 // Returns true if the preference for the given preference name is available |
| 167 // and is controlled by the parent/guardian of the child Account. |
| 168 bool IsPreferenceManagedByCustodian(const std::string& pref_name) const; |
| 169 |
| 161 // Returns |true| if a preference with the given name is available and its | 170 // Returns |true| if a preference with the given name is available and its |
| 162 // value can be changed by the user. | 171 // value can be changed by the user. |
| 163 bool IsUserModifiablePreference(const std::string& pref_name) const; | 172 bool IsUserModifiablePreference(const std::string& pref_name) const; |
| 164 | 173 |
| 165 // Look up a preference. Returns NULL if the preference is not | 174 // Look up a preference. Returns NULL if the preference is not |
| 166 // registered. | 175 // registered. |
| 167 const PrefService::Preference* FindPreference(const std::string& path) const; | 176 const PrefService::Preference* FindPreference(const std::string& path) const; |
| 168 | 177 |
| 169 // If the path is valid and the value at the end of the path matches the type | 178 // If the path is valid and the value at the end of the path matches the type |
| 170 // specified, it will return the specified value. Otherwise, the default | 179 // specified, it will return the specified value. Otherwise, the default |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 360 |
| 352 // Local cache of registered Preference objects. The pref_registry_ | 361 // Local cache of registered Preference objects. The pref_registry_ |
| 353 // is authoritative with respect to what the types and default values | 362 // is authoritative with respect to what the types and default values |
| 354 // of registered preferences are. | 363 // of registered preferences are. |
| 355 mutable PreferenceMap prefs_map_; | 364 mutable PreferenceMap prefs_map_; |
| 356 | 365 |
| 357 DISALLOW_COPY_AND_ASSIGN(PrefService); | 366 DISALLOW_COPY_AND_ASSIGN(PrefService); |
| 358 }; | 367 }; |
| 359 | 368 |
| 360 #endif // BASE_PREFS_PREF_SERVICE_H_ | 369 #endif // BASE_PREFS_PREF_SERVICE_H_ |
| OLD | NEW |