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

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: Moved reset logic to chrome_pref_service_factory 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 877ab2771c272fa417865f2d2558ed3f7c66118c..aa601561a870a21f4837263d9555f6b8879e471c 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"
@@ -23,6 +24,7 @@
#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"
#include "chrome/browser/prefs/pref_service_syncable_factory.h"
@@ -197,13 +199,20 @@ void HandleReadError(PersistentPrefStore::PrefReadError error) {
}
}
+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(
@@ -359,4 +368,9 @@ void InitializeHashStoreForPrefFile(
pref_store->ReadPrefsAsync(NULL);
}
+void RegisterPrefs(PrefRegistrySimple* registry) {
+ PrefHashFilter::RegisterPrefs(registry);
+ PrefHashStoreImpl::RegisterPrefs(registry);
+}
+
} // namespace chrome_prefs

Powered by Google App Engine
This is Rietveld 408576698