Chromium Code Reviews| 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..be275e2316c219a15d5294c8bdb284a3b18e9fc3 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,12 @@ void ResetPrefHashStore(const base::FilePath& profile_path) { |
| GetPrefHashStoreImpl(profile_path)->Reset(); |
| } |
| +void RegisterPrefs(PrefRegistrySimple* registry) { |
| + // Register the pref that maintains state about the last time a PrefHashFilter |
| + // reset event occurred. Used to decide whether to show UI. |
|
gab
2014/02/07 22:00:19
I don't think a comment about what the pref does i
robertshield
2014/02/10 02:30:53
Done.
|
| + registry->RegisterInt64Pref(prefs::kProfilePreferenceResetTime, 0L); |
| + |
| + PrefHashStoreImpl::RegisterPrefs(registry); |
| +} |
| + |
| } // namespace chrome_prefs |