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

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

Issue 611153004: replace OVERRIDE and FINAL with override and final in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CC_ -> BASE_ Created 6 years, 2 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 | « base/prefs/json_pref_store_unittest.cc ('k') | base/prefs/pref_change_registrar.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 BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ 5 #ifndef BASE_PREFS_OVERLAY_USER_PREF_STORE_H_
6 #define BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ 6 #define BASE_PREFS_OVERLAY_USER_PREF_STORE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 12 matching lines...) Expand all
23 public PrefStore::Observer { 23 public PrefStore::Observer {
24 public: 24 public:
25 explicit OverlayUserPrefStore(PersistentPrefStore* underlay); 25 explicit OverlayUserPrefStore(PersistentPrefStore* underlay);
26 26
27 // Returns true if a value has been set for the |key| in this 27 // Returns true if a value has been set for the |key| in this
28 // OverlayUserPrefStore, i.e. if it potentially overrides a value 28 // OverlayUserPrefStore, i.e. if it potentially overrides a value
29 // from the |underlay_|. 29 // from the |underlay_|.
30 virtual bool IsSetInOverlay(const std::string& key) const; 30 virtual bool IsSetInOverlay(const std::string& key) const;
31 31
32 // Methods of PrefStore. 32 // Methods of PrefStore.
33 virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; 33 virtual void AddObserver(PrefStore::Observer* observer) override;
34 virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; 34 virtual void RemoveObserver(PrefStore::Observer* observer) override;
35 virtual bool HasObservers() const OVERRIDE; 35 virtual bool HasObservers() const override;
36 virtual bool IsInitializationComplete() const OVERRIDE; 36 virtual bool IsInitializationComplete() const override;
37 virtual bool GetValue(const std::string& key, 37 virtual bool GetValue(const std::string& key,
38 const base::Value** result) const OVERRIDE; 38 const base::Value** result) const override;
39 39
40 // Methods of PersistentPrefStore. 40 // Methods of PersistentPrefStore.
41 virtual bool GetMutableValue(const std::string& key, 41 virtual bool GetMutableValue(const std::string& key,
42 base::Value** result) OVERRIDE; 42 base::Value** result) override;
43 virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE; 43 virtual void SetValue(const std::string& key, base::Value* value) override;
44 virtual void SetValueSilently(const std::string& key, 44 virtual void SetValueSilently(const std::string& key,
45 base::Value* value) OVERRIDE; 45 base::Value* value) override;
46 virtual void RemoveValue(const std::string& key) OVERRIDE; 46 virtual void RemoveValue(const std::string& key) override;
47 virtual bool ReadOnly() const OVERRIDE; 47 virtual bool ReadOnly() const override;
48 virtual PrefReadError GetReadError() const OVERRIDE; 48 virtual PrefReadError GetReadError() const override;
49 virtual PrefReadError ReadPrefs() OVERRIDE; 49 virtual PrefReadError ReadPrefs() override;
50 virtual void ReadPrefsAsync(ReadErrorDelegate* delegate) OVERRIDE; 50 virtual void ReadPrefsAsync(ReadErrorDelegate* delegate) override;
51 virtual void CommitPendingWrite() OVERRIDE; 51 virtual void CommitPendingWrite() override;
52 virtual void ReportValueChanged(const std::string& key) OVERRIDE; 52 virtual void ReportValueChanged(const std::string& key) override;
53 53
54 // Methods of PrefStore::Observer. 54 // Methods of PrefStore::Observer.
55 virtual void OnPrefValueChanged(const std::string& key) OVERRIDE; 55 virtual void OnPrefValueChanged(const std::string& key) override;
56 virtual void OnInitializationCompleted(bool succeeded) OVERRIDE; 56 virtual void OnInitializationCompleted(bool succeeded) override;
57 57
58 void RegisterOverlayPref(const std::string& key); 58 void RegisterOverlayPref(const std::string& key);
59 void RegisterOverlayPref(const std::string& overlay_key, 59 void RegisterOverlayPref(const std::string& overlay_key,
60 const std::string& underlay_key); 60 const std::string& underlay_key);
61 61
62 protected: 62 protected:
63 virtual ~OverlayUserPrefStore(); 63 virtual ~OverlayUserPrefStore();
64 64
65 private: 65 private:
66 typedef std::map<std::string, std::string> NamesMap; 66 typedef std::map<std::string, std::string> NamesMap;
67 67
68 const std::string& GetOverlayKey(const std::string& underlay_key) const; 68 const std::string& GetOverlayKey(const std::string& underlay_key) const;
69 const std::string& GetUnderlayKey(const std::string& overlay_key) const; 69 const std::string& GetUnderlayKey(const std::string& overlay_key) const;
70 70
71 // Returns true if |key| corresponds to a preference that shall be stored in 71 // Returns true if |key| corresponds to a preference that shall be stored in
72 // an in-memory PrefStore that is not persisted to disk. 72 // an in-memory PrefStore that is not persisted to disk.
73 bool ShallBeStoredInOverlay(const std::string& key) const; 73 bool ShallBeStoredInOverlay(const std::string& key) const;
74 74
75 ObserverList<PrefStore::Observer, true> observers_; 75 ObserverList<PrefStore::Observer, true> observers_;
76 PrefValueMap overlay_; 76 PrefValueMap overlay_;
77 scoped_refptr<PersistentPrefStore> underlay_; 77 scoped_refptr<PersistentPrefStore> underlay_;
78 NamesMap overlay_to_underlay_names_map_; 78 NamesMap overlay_to_underlay_names_map_;
79 NamesMap underlay_to_overlay_names_map_; 79 NamesMap underlay_to_overlay_names_map_;
80 80
81 DISALLOW_COPY_AND_ASSIGN(OverlayUserPrefStore); 81 DISALLOW_COPY_AND_ASSIGN(OverlayUserPrefStore);
82 }; 82 };
83 83
84 #endif // BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ 84 #endif // BASE_PREFS_OVERLAY_USER_PREF_STORE_H_
OLDNEW
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | base/prefs/pref_change_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698