| Index: components/ntp_snippets/ntp_snippet.cc
|
| diff --git a/components/ntp_snippets/ntp_snippet.cc b/components/ntp_snippets/ntp_snippet.cc
|
| index d5164c56a82a1a81fb4fa30f1f0247e7c162ee1c..06c88749659d62a8fa58cd13aeb1936361727850 100644
|
| --- a/components/ntp_snippets/ntp_snippet.cc
|
| +++ b/components/ntp_snippets/ntp_snippet.cc
|
| @@ -10,6 +10,7 @@
|
|
|
| namespace {
|
|
|
| +const char kScore[] = "score";
|
| const char kContentInfo[] = "contentInfo";
|
|
|
| const char kUrl[] = "url";
|
| @@ -142,6 +143,10 @@ std::unique_ptr<NTPSnippet> NTPSnippet::CreateFromDictionary(
|
| return nullptr;
|
| }
|
|
|
| + double score;
|
| + if (dict.GetDouble(kScore, &score))
|
| + snippet->set_score(score);
|
| +
|
| return snippet;
|
| }
|
|
|
| @@ -198,6 +203,8 @@ std::unique_ptr<base::DictionaryValue> NTPSnippet::ToDictionary() const {
|
| std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue);
|
| result->Set(kContentInfo, std::move(dict));
|
|
|
| + result->SetDouble(kScore, score_);
|
| +
|
| return result;
|
| }
|
|
|
|
|