Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5893)

Unified Diff: chrome/common/pref_store_base.h

Issue 5441002: Clean up pref change notification handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix extension prefs breakage Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/pref_store.h ('k') | chrome/common/pref_store_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3c9f37cd4d5f3d8a34345cf1d17a0ef89b620338
--- /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.
+ virtual void NotifyPrefValueChanged(const std::string& key);
+
+ // Notify observers about initialization being complete.
+ virtual void NotifyInitializationCompleted();
+
+ private:
+ ObserverList<ObserverInterface, true> observers_;
+};
+
+#endif // CHROME_COMMON_PREF_STORE_BASE_H_
« no previous file with comments | « chrome/common/pref_store.h ('k') | chrome/common/pref_store_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698