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

Unified Diff: chrome/browser/prefs/tab_contents_user_pref_store.h

Issue 7838030: WIP: Introduce per-TabContents PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months 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
Index: chrome/browser/prefs/tab_contents_user_pref_store.h
diff --git a/chrome/browser/prefs/tab_contents_user_pref_store.h b/chrome/browser/prefs/tab_contents_user_pref_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..b6e9fe3d3dbeaaff4c10feeccdf0dfc12b2ac033
--- /dev/null
+++ b/chrome/browser/prefs/tab_contents_user_pref_store.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 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_BROWSER_PREFS_TAB_CONTENTS_USER_PREF_STORE_H_
+#define CHROME_BROWSER_PREFS_TAB_CONTENTS_USER_PREF_STORE_H_
+#pragma once
+
+// PersistentPrefStore implementation used with per-TabContents PrefService
+// instances. It's based on PrefValueMap and not persisted to disk.
+class TabContentsUserPrefStore : public PersistentPrefStore {
Mattias Nissler (ping if slow) 2011/09/07 17:54:24 This would hold the pref values set in the per-Tab
+ public:
+ TabContentsUserPrefStore();
+ virtual ~TabContentsUserPrefStore();
+
+ // Methods of PrefStore.
+ virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
+ virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
+ virtual bool IsInitializationComplete() const OVERRIDE;
+ virtual ReadResult GetValue(const std::string& key,
+ const base::Value** result) const OVERRIDE;
+
+ // PersistentPrefStore implementation:
+ virtual ReadResult GetMutableValue(const std::string& key,
+ base::Value** result) OVERRIDE;
+ virtual void ReportValueChanged(const std::string& key) OVERRIDE;
+ virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE;
+ virtual void SetValueSilently(const std::string& key,
+ base::Value* value) OVERRIDE;
+ virtual void RemoveValue(const std::string& key) OVERRIDE;
+ virtual bool ReadOnly() const OVERRIDE;
+ virtual PrefReadError ReadPrefs() OVERRIDE;
+ virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE;
+ virtual bool WritePrefs() OVERRIDE;
+ virtual void ScheduleWritePrefs() OVERRIDE;
+ virtual void CommitPendingWrite() OVERRIDE;
+
+ private:
+ PrefValueMap pref_values_;
+
+ DISALLOW_COPY_AND_ASSIGN(TabContentsUserPrefStore);
+};
+
+#endif // CHROME_BROWSER_PREFS_TAB_CONTENTS_USER_PREF_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698