| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/prefs/incognito_user_pref_store.h" | 5 #include "chrome/browser/prefs/incognito_user_pref_store.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 | 9 |
| 10 OverlayUserPrefStore::OverlayUserPrefStore( | 10 OverlayUserPrefStore::OverlayUserPrefStore( |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return PersistentPrefStore::PREF_READ_ERROR_NONE; | 107 return PersistentPrefStore::PREF_READ_ERROR_NONE; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void OverlayUserPrefStore::ReadPrefsAsync( | 110 void OverlayUserPrefStore::ReadPrefsAsync( |
| 111 ReadErrorDelegate* error_delegate_raw) { | 111 ReadErrorDelegate* error_delegate_raw) { |
| 112 scoped_ptr<ReadErrorDelegate> error_delegate(error_delegate_raw); | 112 scoped_ptr<ReadErrorDelegate> error_delegate(error_delegate_raw); |
| 113 // We do not read intentionally. | 113 // We do not read intentionally. |
| 114 OnInitializationCompleted(true); | 114 OnInitializationCompleted(true); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool OverlayUserPrefStore::WritePrefs() { | |
| 118 // We do not write our content intentionally. | |
| 119 return true; | |
| 120 } | |
| 121 | |
| 122 void OverlayUserPrefStore::ScheduleWritePrefs() { | |
| 123 underlay_->ScheduleWritePrefs(); | |
| 124 // We do not write our content intentionally. | |
| 125 } | |
| 126 | |
| 127 void OverlayUserPrefStore::CommitPendingWrite() { | 117 void OverlayUserPrefStore::CommitPendingWrite() { |
| 128 underlay_->CommitPendingWrite(); | 118 underlay_->CommitPendingWrite(); |
| 129 // We do not write our content intentionally. | 119 // We do not write our content intentionally. |
| 130 } | 120 } |
| 131 | 121 |
| 132 void OverlayUserPrefStore::ReportValueChanged(const std::string& key) { | 122 void OverlayUserPrefStore::ReportValueChanged(const std::string& key) { |
| 133 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, OnPrefValueChanged(key)); | 123 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, OnPrefValueChanged(key)); |
| 134 } | 124 } |
| 135 | 125 |
| 136 void OverlayUserPrefStore::RegisterOverlayProperty(const std::string& key) { | 126 void OverlayUserPrefStore::RegisterOverlayProperty(const std::string& key) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 NamesMap::const_iterator i = | 164 NamesMap::const_iterator i = |
| 175 overlay_to_underlay_names_map_.find(overlay_key); | 165 overlay_to_underlay_names_map_.find(overlay_key); |
| 176 return i != overlay_to_underlay_names_map_.end() ? i->second : overlay_key; | 166 return i != overlay_to_underlay_names_map_.end() ? i->second : overlay_key; |
| 177 } | 167 } |
| 178 | 168 |
| 179 bool OverlayUserPrefStore::ShallBeStoredInOverlay( | 169 bool OverlayUserPrefStore::ShallBeStoredInOverlay( |
| 180 const std::string& key) const { | 170 const std::string& key) const { |
| 181 return overlay_to_underlay_names_map_.find(key) != | 171 return overlay_to_underlay_names_map_.find(key) != |
| 182 overlay_to_underlay_names_map_.end(); | 172 overlay_to_underlay_names_map_.end(); |
| 183 } | 173 } |
| OLD | NEW |