| 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 #ifndef CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/prefs/pref_value_map.h" | 10 #include "base/prefs/pref_value_map.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // will be invoked each time registration and/or unregistration has | 45 // will be invoked each time registration and/or unregistration has |
| 46 // been performed on this object. | 46 // been performed on this object. |
| 47 // | 47 // |
| 48 // Calling either of these methods after a callback has already been | 48 // Calling either of these methods after a callback has already been |
| 49 // set will make the object forget the previous callback and use the | 49 // set will make the object forget the previous callback and use the |
| 50 // new one instead. | 50 // new one instead. |
| 51 void SetRegistrationCallback(const RegistrationCallback& callback); | 51 void SetRegistrationCallback(const RegistrationCallback& callback); |
| 52 void SetUnregistrationCallback(const UnregistrationCallback& callback); | 52 void SetUnregistrationCallback(const UnregistrationCallback& callback); |
| 53 | 53 |
| 54 // Unregisters a preference. This is going away soon. | 54 // Unregisters a preference. This is going away soon. |
| 55 virtual void DeprecatedUnregisterPreference(const char* path); | 55 void DeprecatedUnregisterPreference(const char* path); |
| 56 | 56 |
| 57 protected: | 57 protected: |
| 58 friend class base::RefCounted<PrefRegistry>; | 58 friend class base::RefCounted<PrefRegistry>; |
| 59 virtual ~PrefRegistry(); | 59 virtual ~PrefRegistry(); |
| 60 | 60 |
| 61 // TODO(joi): Temporary until we have PrefRegistrySyncable. | 61 // TODO(joi): Temporary until we have PrefRegistrySyncable. |
| 62 friend class PrefServiceSyncable; | 62 friend class PrefServiceSyncable; |
| 63 | 63 |
| 64 // Used by subclasses to register a default value for a preference. | 64 // Used by subclasses to register a default value for a preference. |
| 65 void RegisterPreference(const char* path, base::Value* default_value); | 65 void RegisterPreference(const char* path, base::Value* default_value); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 RegistrationCallback registration_callback_; | 68 RegistrationCallback registration_callback_; |
| 69 UnregistrationCallback unregistration_callback_; | 69 UnregistrationCallback unregistration_callback_; |
| 70 scoped_refptr<DefaultPrefStore> defaults_; | 70 scoped_refptr<DefaultPrefStore> defaults_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(PrefRegistry); | 72 DISALLOW_COPY_AND_ASSIGN(PrefRegistry); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 #endif // CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ | 75 #endif // CHROME_BROWSER_PREFS_PREF_REGISTRY_H_ |
| OLD | NEW |