Index: base/prefs/pref_filter.h |
diff --git a/base/prefs/pref_filter.h b/base/prefs/pref_filter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aa560871744b1885c9a1e5b45d5ad38dd8c82631 |
--- /dev/null |
+++ b/base/prefs/pref_filter.h |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 2013 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 BASE_PREFS_PREF_FILTER_H_ |
+#define BASE_PREFS_PREF_FILTER_H_ |
+ |
+#include <string> |
+#include "base/prefs/base_prefs_export.h" |
+ |
+class PersistentPrefStore; |
+ |
+// Filters preferences as they are loaded from disk or updated at runtime. |
+// Currently supported only by JsonPrefStore. |
+class BASE_PREFS_EXPORT PrefFilter { |
gab
2013/12/04 22:22:30
I don't really like the term "filter"; to me a fil
erikwright (departed)
2013/12/05 23:48:00
I'm happy to change it. Rather than do that now I'
|
+ public: |
+ virtual ~PrefFilter() {} |
+ |
+ // Receives notification when the pref store data has been loaded but before |
+ // any other clients are notified. |
+ // Changes made by a PrefFilter during FilterOnLoad do not result in |
+ // notifications to |PrefStore::Observer|s. |
+ virtual void FilterOnLoad(PersistentPrefStore* pref_store) = 0; |
+ |
+ // Receives notification when a pref store value is changed, before any other |
+ // clients are notified. |
+ virtual void FilterUpdate(PersistentPrefStore* pref_store, |
+ const std::string& path) = 0; |
+}; |
+ |
+#endif // BASE_PREFS_PREF_FILTER_H_ |