Chromium Code Reviews| Index: chrome/common/pref_store_base.h |
| diff --git a/chrome/common/pref_store_base.h b/chrome/common/pref_store_base.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..960cdf21cd623d1734cdcdb898f1755b71599ce8 |
| --- /dev/null |
| +++ b/chrome/common/pref_store_base.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_COMMON_PREF_STORE_BASE_H_ |
| +#define CHROME_COMMON_PREF_STORE_BASE_H_ |
| +#pragma once |
| + |
| +#include "base/observer_list.h" |
| +#include "chrome/common/pref_store.h" |
| + |
| +// Implements the observer-related bits of the PrefStore interface. This is |
| +// provided as a convenience for PrefStore implementations to derive from. |
| +class PrefStoreBase : public PrefStore { |
| + public: |
| + virtual ~PrefStoreBase() {} |
| + |
| + // Overriden from PrefStore. |
| + virtual void AddObserver(ObserverInterface* observer); |
| + virtual void RemoveObserver(ObserverInterface* observer); |
| + |
| + protected: |
| + // Send a notification about a changed preference value. |
| + void NotifyPrefValueChanged(const std::string& key); |
|
danno
2010/12/06 14:17:53
These should be virtual too.
|
| + |
| + // Notify observers about initialization being complete. |
| + void NotifyInitializationCompleted(); |
| + |
| + private: |
| + ObserverList<ObserverInterface, true> observers_; |
| +}; |
| + |
| +#endif // CHROME_COMMON_PREF_STORE_BASE_H_ |