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

Unified Diff: chrome/browser/prefs/pref_hash_store_impl.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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prefs/pref_hash_store_impl.cc
diff --git a/chrome/browser/prefs/pref_hash_store_impl.cc b/chrome/browser/prefs/pref_hash_store_impl.cc
index 205102cecc4a70c3fd6667aa700a73fd7f83f714..6b3e7647ad43a495d727dbd68c4ffb21d2fbe413 100644
--- a/chrome/browser/prefs/pref_hash_store_impl.cc
+++ b/chrome/browser/prefs/pref_hash_store_impl.cc
@@ -8,6 +8,7 @@
#include "base/metrics/histogram.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
+#include "base/time/time.h"
#include "base/values.h"
#include "chrome/common/pref_names.h"
@@ -28,6 +29,9 @@ void PrefHashStoreImpl::RegisterPrefs(PrefRegistrySimple* registry) {
// Register the top level dictionary to map profile names to dictionaries of
// tracked preferences.
registry->RegisterDictionaryPref(prefs::kProfilePreferenceHashes);
+ // Register the pref that maintains state about the last time a reset event
+ // occurred. Used to decide whether to show UI.
+ registry->RegisterInt64Pref(prefs::kProfilePreferenceResetTime, 0L);
}
void PrefHashStoreImpl::Reset() {
@@ -161,6 +165,11 @@ void PrefHashStoreImpl::StoreSplitHash(
}
}
+void PrefHashStoreImpl::RecordResetEvent() {
gab 2014/02/05 15:23:52 I think this method belongs on TrackedPreferenceHe
robertshield 2014/02/06 18:56:50 Erik convinced me it should go on PrefHashFilter.
+ local_state_->SetInt64(prefs::kProfilePreferenceResetTime,
+ base::Time::Now().ToInternalValue());
+}
+
void PrefHashStoreImpl::ClearPath(const std::string& path,
DictionaryPrefUpdate* update) {
base::DictionaryValue* hashes_dict = NULL;

Powered by Google App Engine
This is Rietveld 408576698