| Index: components/user_prefs/tracked/pref_hash_filter.cc
|
| diff --git a/chrome/browser/prefs/tracked/pref_hash_filter.cc b/components/user_prefs/tracked/pref_hash_filter.cc
|
| similarity index 90%
|
| rename from chrome/browser/prefs/tracked/pref_hash_filter.cc
|
| rename to components/user_prefs/tracked/pref_hash_filter.cc
|
| index 5fe4fa14e0d156c8dcedb1de1ded23228706af8e..5567c5c02743e66a92803063fd400adf35114438 100644
|
| --- a/chrome/browser/prefs/tracked/pref_hash_filter.cc
|
| +++ b/components/user_prefs/tracked/pref_hash_filter.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/prefs/tracked/pref_hash_filter.h"
|
| +#include "components/user_prefs/tracked/pref_hash_filter.h"
|
|
|
| #include <algorithm>
|
|
|
| @@ -13,13 +13,13 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/time/time.h"
|
| #include "base/values.h"
|
| -#include "chrome/browser/prefs/tracked/dictionary_hash_store_contents.h"
|
| -#include "chrome/browser/prefs/tracked/pref_hash_store.h"
|
| -#include "chrome/browser/prefs/tracked/pref_hash_store_transaction.h"
|
| -#include "chrome/browser/prefs/tracked/tracked_atomic_preference.h"
|
| -#include "chrome/browser/prefs/tracked/tracked_split_preference.h"
|
| -#include "chrome/common/pref_names.h"
|
| #include "components/pref_registry/pref_registry_syncable.h"
|
| +#include "components/user_prefs/tracked/dictionary_hash_store_contents.h"
|
| +#include "components/user_prefs/tracked/pref_hash_store.h"
|
| +#include "components/user_prefs/tracked/pref_hash_store_transaction.h"
|
| +#include "components/user_prefs/tracked/pref_names.h"
|
| +#include "components/user_prefs/tracked/tracked_atomic_preference.h"
|
| +#include "components/user_prefs/tracked/tracked_split_preference.h"
|
|
|
| namespace {
|
|
|
| @@ -29,10 +29,10 @@ void CleanupDeprecatedTrackedPreferences(
|
| // Add deprecated previously tracked preferences below for them to be cleaned
|
| // up from both the pref files and the hash store.
|
| static const char* const kDeprecatedTrackedPreferences[] = {
|
| - // TODO(grt): Remove in M44+.
|
| - "safebrowsing.incident_report_sent",
|
| - // TODO(mad): Remove in M48+.
|
| - "software_reporter.prompt_reason",
|
| + // TODO(grt): Remove in M44+.
|
| + "safebrowsing.incident_report_sent",
|
| + // TODO(mad): Remove in M48+.
|
| + "software_reporter.prompt_reason",
|
| };
|
|
|
| for (size_t i = 0; i < arraysize(kDeprecatedTrackedPreferences); ++i) {
|
| @@ -100,7 +100,7 @@ void PrefHashFilter::RegisterProfilePrefs(
|
| user_prefs::PrefRegistrySyncable* registry) {
|
| // See GetResetTime for why this is a StringPref and not Int64Pref.
|
| registry->RegisterStringPref(
|
| - prefs::kPreferenceResetTime,
|
| + user_prefs_prefs::kPreferenceResetTime,
|
| base::Int64ToString(base::Time().ToInternalValue()));
|
| }
|
|
|
| @@ -112,7 +112,7 @@ base::Time PrefHashFilter::GetResetTime(PrefService* user_prefs) {
|
| // PrefService::SetInt64).
|
| int64 internal_value = base::Time().ToInternalValue();
|
| if (!base::StringToInt64(
|
| - user_prefs->GetString(prefs::kPreferenceResetTime),
|
| + user_prefs->GetString(user_prefs_prefs::kPreferenceResetTime),
|
| &internal_value)) {
|
| // Somehow the value stored on disk is not a valid int64.
|
| NOTREACHED();
|
| @@ -123,7 +123,7 @@ base::Time PrefHashFilter::GetResetTime(PrefService* user_prefs) {
|
|
|
| // static
|
| void PrefHashFilter::ClearResetTime(PrefService* user_prefs) {
|
| - user_prefs->ClearPref(prefs::kPreferenceResetTime);
|
| + user_prefs->ClearPref(user_prefs_prefs::kPreferenceResetTime);
|
| }
|
|
|
| void PrefHashFilter::Initialize(base::DictionaryValue* pref_store_contents) {
|
| @@ -211,10 +211,10 @@ void PrefHashFilter::FinalizeFilterOnLoad(
|
| }
|
|
|
| if (did_reset) {
|
| - pref_store_contents->Set(prefs::kPreferenceResetTime,
|
| + pref_store_contents->Set(user_prefs_prefs::kPreferenceResetTime,
|
| new base::StringValue(base::Int64ToString(
|
| base::Time::Now().ToInternalValue())));
|
| - FilterUpdate(prefs::kPreferenceResetTime);
|
| + FilterUpdate(user_prefs_prefs::kPreferenceResetTime);
|
|
|
| if (!on_reset_on_load_.is_null())
|
| on_reset_on_load_.Run();
|
|
|