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

Unified Diff: chrome/browser/prefs/chrome_pref_service_factory.cc

Issue 151003004: Add an automatic settings reset banner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bernhard's feedback. 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/chrome_pref_service_factory.cc
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc
index 170975e65c99b502231e1a38b07d450bb0a94377..b8e8521003ca6e724d799b9418382d616b38e839 100644
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
@@ -16,6 +16,7 @@
#include "base/prefs/pref_filter.h"
#include "base/prefs/pref_notifier_impl.h"
#include "base/prefs/pref_registry.h"
+#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/pref_store.h"
#include "base/prefs/pref_value_store.h"
@@ -24,6 +25,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/command_line_pref_store.h"
#include "chrome/browser/prefs/pref_hash_filter.h"
+#include "chrome/browser/prefs/pref_hash_store.h"
#include "chrome/browser/prefs/pref_hash_store_impl.h"
#include "chrome/browser/prefs/pref_model_associator.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
@@ -242,13 +244,20 @@ scoped_ptr<PrefHashStoreImpl> GetPrefHashStoreImpl(
#endif
}
+void HandleResetEvent() {
+ g_browser_process->local_state()->SetInt64(
+ prefs::kProfilePreferenceResetTime,
+ base::Time::Now().ToInternalValue());
+}
+
scoped_ptr<PrefHashFilter> CreatePrefHashFilter(
scoped_ptr<PrefHashStore> pref_hash_store) {
return make_scoped_ptr(new PrefHashFilter(pref_hash_store.Pass(),
kTrackedPrefs,
arraysize(kTrackedPrefs),
kTrackedPrefsReportingIDsCount,
- GetSettingsEnforcementLevel()));
+ GetSettingsEnforcementLevel(),
+ base::Bind(&HandleResetEvent)));
}
void PrepareBuilder(
@@ -412,4 +421,9 @@ void ResetPrefHashStore(const base::FilePath& profile_path) {
GetPrefHashStoreImpl(profile_path)->Reset();
}
+void RegisterPrefs(PrefRegistrySimple* registry) {
+ PrefHashFilter::RegisterPrefs(registry);
gab 2014/02/07 19:38:31 PrefHashFilter no longer sets the pref so it shoul
robertshield 2014/02/07 21:21:35 Done.
+ PrefHashStoreImpl::RegisterPrefs(registry);
+}
+
} // namespace chrome_prefs

Powered by Google App Engine
This is Rietveld 408576698