Send compressed histograms with system logs when sending feedback.
[chromium-blink-merge.git] / android_webview / browser / aw_pref_store.h
blob8581a03443cdb4952dbcb982cc785d0b0c6693fd
1 // Copyright (c) 2013 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.
5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_PREF_STORE_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_PREF_STORE_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/observer_list.h"
13 #include "base/prefs/persistent_pref_store.h"
14 #include "base/prefs/pref_value_map.h"
16 // A light-weight prefstore implementation that keeps preferences
17 // in a memory backed store. This is not a persistent prefstore -- we
18 // subclass the PersistentPrefStore here since it is needed by the
19 // PrefService, which in turn is needed by the Autofill component.
20 class AwPrefStore : public PersistentPrefStore {
21 public:
22 AwPrefStore();
24 // Overriden from PrefStore.
25 virtual bool GetValue(const std::string& key,
26 const base::Value** result) const OVERRIDE;
27 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
28 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
29 virtual bool HasObservers() const OVERRIDE;
30 virtual bool IsInitializationComplete() const OVERRIDE;
32 // PersistentPrefStore overrides:
33 virtual bool GetMutableValue(const std::string& key,
34 base::Value** result) OVERRIDE;
35 virtual void ReportValueChanged(const std::string& key) OVERRIDE;
36 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE;
37 virtual void SetValueSilently(const std::string& key,
38 base::Value* value) OVERRIDE;
39 virtual void RemoveValue(const std::string& key) OVERRIDE;
40 virtual void MarkNeedsEmptyValue(const std::string& key) OVERRIDE;
41 virtual bool ReadOnly() const OVERRIDE;
42 virtual PrefReadError GetReadError() const OVERRIDE;
43 virtual PersistentPrefStore::PrefReadError ReadPrefs() OVERRIDE;
44 virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE;
45 virtual void CommitPendingWrite() OVERRIDE {}
47 protected:
48 virtual ~AwPrefStore();
50 private:
51 // Stores the preference values.
52 PrefValueMap prefs_;
54 ObserverList<PrefStore::Observer, true> observers_;
56 DISALLOW_COPY_AND_ASSIGN(AwPrefStore);
59 #endif // ANDROID_WEBVIEW_BROWSER_AW_PREF_STORE_H_