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

Unified Diff: components/user_prefs/tracked/pref_hash_filter.cc

Issue 1227973003: Componentize //chrome/browser/prefs/tracked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 4 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: 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..d3cd61d714bb3694ba4cf3eb96e8527ab169fdee 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::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::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::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::kPreferenceResetTime,
new base::StringValue(base::Int64ToString(
base::Time::Now().ToInternalValue())));
- FilterUpdate(prefs::kPreferenceResetTime);
+ FilterUpdate(user_prefs::kPreferenceResetTime);
if (!on_reset_on_load_.is_null())
on_reset_on_load_.Run();
« no previous file with comments | « components/user_prefs/tracked/pref_hash_filter.h ('k') | components/user_prefs/tracked/pref_hash_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698