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

Side by Side Diff: components/prefs/overlay_user_pref_store.h

Issue 1662843002: Revert of Delete base/prefs and update callers to use components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/prefs/mock_pref_change_callback.h ('k') | components/prefs/persistent_pref_store.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PREFS_OVERLAY_USER_PREF_STORE_H_ 5 #ifndef BASE_PREFS_OVERLAY_USER_PREF_STORE_H_
6 #define COMPONENTS_PREFS_OVERLAY_USER_PREF_STORE_H_ 6 #define BASE_PREFS_OVERLAY_USER_PREF_STORE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "components/prefs/base_prefs_export.h" 16 #include "components/prefs/base_prefs_export.h"
17 #include "components/prefs/persistent_pref_store.h" 17 #include "components/prefs/persistent_pref_store.h"
18 #include "components/prefs/pref_value_map.h" 18 #include "components/prefs/pref_value_map.h"
19 19
20 // PersistentPrefStore that directs all write operations into an in-memory 20 // PersistentPrefStore that directs all write operations into an in-memory
21 // PrefValueMap. Read operations are first answered by the PrefValueMap. 21 // PrefValueMap. Read operations are first answered by the PrefValueMap.
22 // If the PrefValueMap does not contain a value for the requested key, 22 // If the PrefValueMap does not contain a value for the requested key,
23 // the look-up is passed on to an underlying PersistentPrefStore |underlay_|. 23 // the look-up is passed on to an underlying PersistentPrefStore |underlay_|.
24 class COMPONENTS_PREFS_EXPORT OverlayUserPrefStore : public PersistentPrefStore, 24 class BASE_PREFS_EXPORT OverlayUserPrefStore : public PersistentPrefStore,
25 public PrefStore::Observer { 25 public PrefStore::Observer {
26 public: 26 public:
27 explicit OverlayUserPrefStore(PersistentPrefStore* underlay); 27 explicit OverlayUserPrefStore(PersistentPrefStore* underlay);
28 28
29 // Returns true if a value has been set for the |key| in this 29 // Returns true if a value has been set for the |key| in this
30 // OverlayUserPrefStore, i.e. if it potentially overrides a value 30 // OverlayUserPrefStore, i.e. if it potentially overrides a value
31 // from the |underlay_|. 31 // from the |underlay_|.
32 virtual bool IsSetInOverlay(const std::string& key) const; 32 virtual bool IsSetInOverlay(const std::string& key) const;
33 33
34 // Methods of PrefStore. 34 // Methods of PrefStore.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 base::ObserverList<PrefStore::Observer, true> observers_; 80 base::ObserverList<PrefStore::Observer, true> observers_;
81 PrefValueMap overlay_; 81 PrefValueMap overlay_;
82 scoped_refptr<PersistentPrefStore> underlay_; 82 scoped_refptr<PersistentPrefStore> underlay_;
83 NamesMap overlay_to_underlay_names_map_; 83 NamesMap overlay_to_underlay_names_map_;
84 NamesMap underlay_to_overlay_names_map_; 84 NamesMap underlay_to_overlay_names_map_;
85 85
86 DISALLOW_COPY_AND_ASSIGN(OverlayUserPrefStore); 86 DISALLOW_COPY_AND_ASSIGN(OverlayUserPrefStore);
87 }; 87 };
88 88
89 #endif // COMPONENTS_PREFS_OVERLAY_USER_PREF_STORE_H_ 89 #endif // BASE_PREFS_OVERLAY_USER_PREF_STORE_H_
OLDNEW
« no previous file with comments | « components/prefs/mock_pref_change_callback.h ('k') | components/prefs/persistent_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698