| 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 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 void IncognitoUserPrefStore::CommitPendingWrite() { | 128 void IncognitoUserPrefStore::CommitPendingWrite() { |
| 129 underlay_->CommitPendingWrite(); | 129 underlay_->CommitPendingWrite(); |
| 130 // We do not write our content intentionally. | 130 // We do not write our content intentionally. |
| 131 } | 131 } |
| 132 | 132 |
| 133 void IncognitoUserPrefStore::ReportValueChanged(const std::string& key) { | 133 void IncognitoUserPrefStore::ReportValueChanged(const std::string& key) { |
| 134 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, OnPrefValueChanged(key)); | 134 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, OnPrefValueChanged(key)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void IncognitoUserPrefStore::CheckIfValueDestroyed(const std::string& key) { | |
| 138 } | |
| 139 | |
| 140 void IncognitoUserPrefStore::OnPrefValueChanged(const std::string& key) { | 137 void IncognitoUserPrefStore::OnPrefValueChanged(const std::string& key) { |
| 141 if (!overlay_.GetValue(key, NULL)) | 138 if (!overlay_.GetValue(key, NULL)) |
| 142 ReportValueChanged(key); | 139 ReportValueChanged(key); |
| 143 } | 140 } |
| 144 | 141 |
| 145 void IncognitoUserPrefStore::OnInitializationCompleted(bool succeeded) { | 142 void IncognitoUserPrefStore::OnInitializationCompleted(bool succeeded) { |
| 146 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, | 143 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, |
| 147 OnInitializationCompleted(succeeded)); | 144 OnInitializationCompleted(succeeded)); |
| 148 } | 145 } |
| 149 | 146 |
| 150 bool IncognitoUserPrefStore::ShallBeStoredInOverlay( | 147 bool IncognitoUserPrefStore::ShallBeStoredInOverlay( |
| 151 const std::string& key) const { | 148 const std::string& key) const { |
| 152 // List of keys that cannot be changed in the user prefs file by the incognito | 149 // List of keys that cannot be changed in the user prefs file by the incognito |
| 153 // profile: | 150 // profile: |
| 154 return key == prefs::kBrowserWindowPlacement; | 151 return key == prefs::kBrowserWindowPlacement; |
| 155 } | 152 } |
| OLD | NEW |