Commit 8e33a4d9 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Remove uses of deprecated RegisterListPref

The override of RegisterListPref taking a std::unique_ptr<base::Value>
is deprecated in favor of the method taking the base::Value by value.

Convert client code to either not pass default value if the value is just
an empty list (as there is an override doing this). If the list is not
empty, convert the code to create and pass it by value.

This CL was uploaded by git cl split.

Bug: 646113
Change-Id: Iadc20eb6a3eacf1d8c67b4ea25635b9796b2afba
Reviewed-on: https://chromium-review.googlesource.com/c/1454584Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629175}
parent b2dd6615
......@@ -214,12 +214,12 @@ void SetDefaultResourceForSite(int index,
#endif
// Creates the list of popular sites based on a snapshot available for mobile.
std::unique_ptr<base::ListValue> DefaultPopularSites() {
base::Value DefaultPopularSites() {
#if !defined(OS_ANDROID) && !defined(OS_IOS)
return std::make_unique<base::ListValue>();
return base::Value(base::Value::Type::LIST);
#else
if (!base::FeatureList::IsEnabled(kPopularSitesBakedInContentFeature)) {
return std::make_unique<base::ListValue>();
return base::Value(base::Value::Type::LIST);
}
std::unique_ptr<base::ListValue> sites =
base::ListValue::From(base::JSONReader::Read(
......@@ -240,7 +240,7 @@ std::unique_ptr<base::ListValue> DefaultPopularSites() {
SetDefaultResourceForSite(index++, icon_resource, sites.get());
}
#endif // GOOGLE_CHROME_BUILD
return sites;
return base::Value::FromUniquePtrValue(std::move(sites));
#endif // OS_ANDROID || OS_IOS
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment