OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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_BROWSER_PREFS_TAB_CONTENTS_USER_PREF_STORE_H_ |
| 6 #define CHROME_BROWSER_PREFS_TAB_CONTENTS_USER_PREF_STORE_H_ |
| 7 #pragma once |
| 8 |
| 9 // PersistentPrefStore implementation used with per-TabContents PrefService |
| 10 // instances. It's based on PrefValueMap and not persisted to disk. |
| 11 class TabContentsUserPrefStore : public PersistentPrefStore { |
| 12 public: |
| 13 TabContentsUserPrefStore(); |
| 14 virtual ~TabContentsUserPrefStore(); |
| 15 |
| 16 // Methods of PrefStore. |
| 17 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; |
| 18 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; |
| 19 virtual bool IsInitializationComplete() const OVERRIDE; |
| 20 virtual ReadResult GetValue(const std::string& key, |
| 21 const base::Value** result) const OVERRIDE; |
| 22 |
| 23 // PersistentPrefStore implementation: |
| 24 virtual ReadResult GetMutableValue(const std::string& key, |
| 25 base::Value** result) OVERRIDE; |
| 26 virtual void ReportValueChanged(const std::string& key) OVERRIDE; |
| 27 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE; |
| 28 virtual void SetValueSilently(const std::string& key, |
| 29 base::Value* value) OVERRIDE; |
| 30 virtual void RemoveValue(const std::string& key) OVERRIDE; |
| 31 virtual bool ReadOnly() const OVERRIDE; |
| 32 virtual PrefReadError ReadPrefs() OVERRIDE; |
| 33 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE; |
| 34 virtual bool WritePrefs() OVERRIDE; |
| 35 virtual void ScheduleWritePrefs() OVERRIDE; |
| 36 virtual void CommitPendingWrite() OVERRIDE; |
| 37 |
| 38 private: |
| 39 PrefValueMap pref_values_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(TabContentsUserPrefStore); |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_PREFS_TAB_CONTENTS_USER_PREF_STORE_H_ |
OLD | NEW |