OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_PREF_STORE_BASE_H_ |
| 6 #define CHROME_COMMON_PREF_STORE_BASE_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/observer_list.h" |
| 10 #include "chrome/common/pref_store.h" |
| 11 |
| 12 // Implements the observer-related bits of the PrefStore interface. This is |
| 13 // provided as a convenience for PrefStore implementations to derive from. |
| 14 class PrefStoreBase : public PrefStore { |
| 15 public: |
| 16 virtual ~PrefStoreBase() {} |
| 17 |
| 18 // Overriden from PrefStore. |
| 19 virtual void AddObserver(ObserverInterface* observer); |
| 20 virtual void RemoveObserver(ObserverInterface* observer); |
| 21 |
| 22 protected: |
| 23 // Send a notification about a changed preference value. |
| 24 virtual void NotifyPrefValueChanged(const std::string& key); |
| 25 |
| 26 // Notify observers about initialization being complete. |
| 27 virtual void NotifyInitializationCompleted(); |
| 28 |
| 29 private: |
| 30 ObserverList<ObserverInterface, true> observers_; |
| 31 }; |
| 32 |
| 33 #endif // CHROME_COMMON_PREF_STORE_BASE_H_ |
OLD | NEW |