| Index: components/ntp_snippets/ntp_snippets_service.cc
|
| diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
|
| index 84dfaecdbeaba33b4e7e12317311c991a182ecad..2dbf344a3fd90a37a6ae422a3dc95bc04b534a52 100644
|
| --- a/components/ntp_snippets/ntp_snippets_service.cc
|
| +++ b/components/ntp_snippets/ntp_snippets_service.cc
|
| @@ -141,16 +141,6 @@ bool AddSnippetsFromListValue(const base::ListValue& list,
|
| return true;
|
| }
|
|
|
| -scoped_ptr<base::ListValue> SnippetsToListValue(
|
| - const NTPSnippetsService::NTPSnippetStorage& snippets) {
|
| - scoped_ptr<base::ListValue> list(new base::ListValue);
|
| - for (const auto& snippet : snippets) {
|
| - scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
| - dict->Set(kContentInfo, snippet->ToDictionary());
|
| - list->Append(std::move(dict));
|
| - }
|
| - return list;
|
| -}
|
|
|
| bool ContainsSnippet(const NTPSnippetsService::NTPSnippetStorage& haystack,
|
| const scoped_ptr<NTPSnippet>& needle) {
|
| @@ -392,6 +382,17 @@ bool NTPSnippetsService::LoadFromListValue(const base::ListValue& list) {
|
| return true;
|
| }
|
|
|
| +scoped_ptr<base::ListValue> NTPSnippetsService::SnippetsToListValue(
|
| + const NTPSnippetsService::NTPSnippetStorage& snippets) const {
|
| + scoped_ptr<base::ListValue> list(new base::ListValue);
|
| + for (const auto& snippet : snippets) {
|
| + scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
| + dict->Set(kContentInfo, snippet->ToDictionary());
|
| + list->Append(std::move(dict));
|
| + }
|
| + return list;
|
| +}
|
| +
|
| void NTPSnippetsService::LoadSnippetsFromPrefs() {
|
| bool success = LoadFromListValue(*pref_service_->GetList(prefs::kSnippets));
|
| DCHECK(success) << "Failed to parse snippets from prefs";
|
|
|