| 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 // 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 #ifndef CHROME_BROWSER_PREF_SERVICE_H_ | 7 #ifndef CHROME_BROWSER_PREF_SERVICE_H_ |
| 8 #define CHROME_BROWSER_PREF_SERVICE_H_ | 8 #define CHROME_BROWSER_PREF_SERVICE_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 Value::ValueType type_; | 94 Value::ValueType type_; |
| 95 std::wstring name_; | 95 std::wstring name_; |
| 96 scoped_ptr<Value> default_value_; | 96 scoped_ptr<Value> default_value_; |
| 97 | 97 |
| 98 // A reference to the pref service's pref_value_store_. | 98 // A reference to the pref service's pref_value_store_. |
| 99 PrefValueStore* pref_value_store_; | 99 PrefValueStore* pref_value_store_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(Preference); | 101 DISALLOW_COPY_AND_ASSIGN(Preference); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // Factory method that creates a new instance of a |PrefService| with | 104 // Factory method that creates a new instance of a PrefService with |
| 105 // all platform-applicable PrefStores (managed, extension, user, etc.). | 105 // a PrefValueStore containing all platform-applicable PrefStores. |
| 106 // The |pref_filename| points to the user preference file. The |profile| is | 106 // The |pref_filename| points to the user preference file. The |profile| is |
| 107 // the one to which these preferences apply; it may be NULL if we're dealing | 107 // the one to which these preferences apply; it may be NULL if we're dealing |
| 108 // with the local state. This is the usual way to create a new PrefService. | 108 // with the local state. This is the usual way to create a new PrefService. |
| 109 static PrefService* CreatePrefService(const FilePath& pref_filename, | 109 static PrefService* CreatePrefService(const FilePath& pref_filename, |
| 110 Profile* profile); | 110 Profile* profile); |
| 111 | 111 |
| 112 // Convenience factory method for use in unit tests. Creates a new | 112 // Convenience factory method for use in unit tests. Creates a new |
| 113 // PrefService that uses a PrefValueStore with user preferences at the given | 113 // PrefService that uses a PrefValueStore with user preferences at the given |
| 114 // |pref_filename|, and no other PrefStores (i.e., no other types of | 114 // |pref_filename|, and no other PrefStores (i.e., no other types of |
| 115 // preferences). | 115 // preferences). |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 typedef base::hash_map<std::wstring, NotificationObserverList*> | 295 typedef base::hash_map<std::wstring, NotificationObserverList*> |
| 296 PrefObserverMap; | 296 PrefObserverMap; |
| 297 PrefObserverMap pref_observers_; | 297 PrefObserverMap pref_observers_; |
| 298 | 298 |
| 299 friend class ScopedPrefUpdate; | 299 friend class ScopedPrefUpdate; |
| 300 | 300 |
| 301 DISALLOW_COPY_AND_ASSIGN(PrefService); | 301 DISALLOW_COPY_AND_ASSIGN(PrefService); |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 #endif // CHROME_BROWSER_PREF_SERVICE_H_ | 304 #endif // CHROME_BROWSER_PREF_SERVICE_H_ |
| OLD | NEW |