Chromium Code Reviews

Side by Side Diff: chrome/browser/prefs/tracked/tracked_split_preference.cc

Issue 151003004: Add an automatic settings reset banner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pre-review cleanup. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/tracked/tracked_split_preference.h" 5 #include "chrome/browser/prefs/tracked/tracked_split_preference.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 46 matching lines...)
57 if (value_state == PrefHashStore::CHANGED) { 57 if (value_state == PrefHashStore::CHANGED) {
58 DCHECK(!invalid_keys.empty()); 58 DCHECK(!invalid_keys.empty());
59 59
60 for (std::vector<std::string>::const_iterator it = 60 for (std::vector<std::string>::const_iterator it =
61 invalid_keys.begin(); it != invalid_keys.end(); ++it) { 61 invalid_keys.begin(); it != invalid_keys.end(); ++it) {
62 dict_value->Remove(*it, NULL); 62 dict_value->Remove(*it, NULL);
63 } 63 }
64 } else { 64 } else {
65 pref_store_contents->RemovePath(pref_path_, NULL); 65 pref_store_contents->RemovePath(pref_path_, NULL);
66 } 66 }
67 pref_hash_store_->RecordResetEvent();
67 } 68 }
68 69
69 if (value_state != PrefHashStore::UNCHANGED) { 70 if (value_state != PrefHashStore::UNCHANGED) {
70 // Store the hash for the new value (whether it was reset or not). 71 // Store the hash for the new value (whether it was reset or not).
71 const base::DictionaryValue* new_dict_value = NULL; 72 const base::DictionaryValue* new_dict_value = NULL;
72 pref_store_contents->GetDictionary(pref_path_, &new_dict_value); 73 pref_store_contents->GetDictionary(pref_path_, &new_dict_value);
73 pref_hash_store_->StoreSplitHash(pref_path_, new_dict_value); 74 pref_hash_store_->StoreSplitHash(pref_path_, new_dict_value);
74 } 75 }
75 } 76 }
OLDNEW

Powered by Google App Engine