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

Side by Side Diff: chrome/browser/policy/configuration_policy_pref_store.cc

Issue 7342043: Fixed regression: various preferences were not persisted when changed from incognito window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
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/policy/configuration_policy_pref_store.h" 5 #include "chrome/browser/policy/configuration_policy_pref_store.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 const Value** result) const { 320 const Value** result) const {
321 const Value* stored_value = NULL; 321 const Value* stored_value = NULL;
322 if (!prefs_.GetValue(key, &stored_value)) 322 if (!prefs_.GetValue(key, &stored_value))
323 return PrefStore::READ_NO_VALUE; 323 return PrefStore::READ_NO_VALUE;
324 324
325 // Check whether there's a default value, which indicates READ_USE_DEFAULT 325 // Check whether there's a default value, which indicates READ_USE_DEFAULT
326 // should be returned. 326 // should be returned.
327 if (stored_value->IsType(Value::TYPE_NULL)) 327 if (stored_value->IsType(Value::TYPE_NULL))
328 return PrefStore::READ_USE_DEFAULT; 328 return PrefStore::READ_USE_DEFAULT;
329 329
330 *result = stored_value; 330 if (result)
331 *result = stored_value;
331 return PrefStore::READ_OK; 332 return PrefStore::READ_OK;
332 } 333 }
333 334
334 void ConfigurationPolicyPrefKeeper::GetDifferingPrefPaths( 335 void ConfigurationPolicyPrefKeeper::GetDifferingPrefPaths(
335 const ConfigurationPolicyPrefKeeper* other, 336 const ConfigurationPolicyPrefKeeper* other,
336 std::vector<std::string>* differing_prefs) const { 337 std::vector<std::string>* differing_prefs) const {
337 prefs_.GetDifferingKeys(&other->prefs_, differing_prefs); 338 prefs_.GetDifferingKeys(&other->prefs_, differing_prefs);
338 } 339 }
339 340
340 void ConfigurationPolicyPrefKeeper::Apply(ConfigurationPolicyType policy, 341 void ConfigurationPolicyPrefKeeper::Apply(ConfigurationPolicyType policy,
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 // Update the initialization flag. 1131 // Update the initialization flag.
1131 if (!initialization_complete_ && 1132 if (!initialization_complete_ &&
1132 provider_->IsInitializationComplete()) { 1133 provider_->IsInitializationComplete()) {
1133 initialization_complete_ = true; 1134 initialization_complete_ = true;
1134 FOR_EACH_OBSERVER(PrefStore::Observer, observers_, 1135 FOR_EACH_OBSERVER(PrefStore::Observer, observers_,
1135 OnInitializationCompleted(true)); 1136 OnInitializationCompleted(true));
1136 } 1137 }
1137 } 1138 }
1138 1139
1139 } // namespace policy 1140 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698