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

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: Rebase on top of transaction patch. 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
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_factory.h ('k') | chrome/browser/prefs/pref_hash_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dd4124cee7196218a389e872df5965cdbe5599a4..1fd2697804060c1b15686bd76d0e7cfcd84129fa 100644
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
@@ -17,6 +17,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"
@@ -26,6 +27,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"
@@ -264,13 +266,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(
@@ -493,4 +502,9 @@ bool InitializePrefsFromMasterPrefs(
return success;
}
+void RegisterPrefs(PrefRegistrySimple* registry) {
+ registry->RegisterInt64Pref(prefs::kProfilePreferenceResetTime, 0L);
+ PrefHashStoreImpl::RegisterPrefs(registry);
+}
+
} // namespace chrome_prefs
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_factory.h ('k') | chrome/browser/prefs/pref_hash_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698