| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COMMON_PREF_STORE_H_ | 5 #ifndef CHROME_COMMON_PREF_STORE_H_ |
| 6 #define CHROME_COMMON_PREF_STORE_H_ | 6 #define CHROME_COMMON_PREF_STORE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 PrefStore() {} | 48 PrefStore() {} |
| 49 | 49 |
| 50 // Add and remove observers. | 50 // Add and remove observers. |
| 51 virtual void AddObserver(Observer* observer) {} | 51 virtual void AddObserver(Observer* observer) {} |
| 52 virtual void RemoveObserver(Observer* observer) {} | 52 virtual void RemoveObserver(Observer* observer) {} |
| 53 | 53 |
| 54 // Whether the store has completed all asynchronous initialization. | 54 // Whether the store has completed all asynchronous initialization. |
| 55 virtual bool IsInitializationComplete() const; | 55 virtual bool IsInitializationComplete() const; |
| 56 | 56 |
| 57 // Get the value for a given preference |key| and stores it in |result|. | 57 // Get the value for a given preference |key| and stores it in |*result|. |
| 58 // |result| is only modified if the return value is READ_OK. Ownership of the | 58 // |*result| is only modified if the return value is READ_OK and if |result| |
| 59 // |result| value remains with the PrefStore. | 59 // is not NULL. Ownership of the |*result| value remains with the PrefStore. |
| 60 virtual ReadResult GetValue(const std::string& key, | 60 virtual ReadResult GetValue(const std::string& key, |
| 61 const base::Value** result) const = 0; | 61 const base::Value** result) const = 0; |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 friend class base::RefCounted<PrefStore>; | 64 friend class base::RefCounted<PrefStore>; |
| 65 virtual ~PrefStore() {} | 65 virtual ~PrefStore() {} |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(PrefStore); | 68 DISALLOW_COPY_AND_ASSIGN(PrefStore); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // CHROME_COMMON_PREF_STORE_H_ | 71 #endif // CHROME_COMMON_PREF_STORE_H_ |
| OLD | NEW |