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

Unified Diff: components/ntp_snippets/ntp_snippet.h

Issue 1737563003: [NTP Snippets] Persist the set of snippets in a pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_merge
Patch Set: noyau review Created 4 years, 10 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
« no previous file with comments | « components/ntp_snippets/DEPS ('k') | components/ntp_snippets/ntp_snippet.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippet.h
diff --git a/components/ntp_snippets/ntp_snippet.h b/components/ntp_snippets/ntp_snippet.h
index 6dd2ad045bc64ab617cf2b893284aed0cd6ce09f..daa1d52fa3971a25a8af52d05e790992520851a8 100644
--- a/components/ntp_snippets/ntp_snippet.h
+++ b/components/ntp_snippets/ntp_snippet.h
@@ -1,6 +1,7 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
#ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
#define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
@@ -29,9 +30,11 @@ class NTPSnippet {
// dictionary doesn't contain at least a url. The keys in the dictionary are
// expected to be the same as the property name, with exceptions documented in
// the property comment.
- static scoped_ptr<NTPSnippet> NTPSnippetFromDictionary(
+ static scoped_ptr<NTPSnippet> CreateFromDictionary(
const base::DictionaryValue& dict);
+ scoped_ptr<base::DictionaryValue> ToDictionary() const;
+
// URL of the page described by this snippet.
const GURL& url() const { return url_; }
@@ -54,15 +57,15 @@ class NTPSnippet {
void set_snippet(const std::string& snippet) { snippet_ = snippet; }
// Link to an image representative of the content. Do not fetch this image
- // directly. If initialized by NTPSnippetFromDictionary() the relevant key is
- // 'thumbnailURL'
+ // directly. If initialized by CreateFromDictionary() the relevant key is
+ // 'thumbnailUrl'
const GURL& salient_image_url() const { return salient_image_url_; }
void set_salient_image_url(const GURL& salient_image_url) {
salient_image_url_ = salient_image_url;
}
// When the page pointed by this snippet was published. If initialized by
- // NTPSnippetFromDictionary() the relevant key is 'creationTimestampSec'
+ // CreateFromDictionary() the relevant key is 'creationTimestampSec'
const base::Time& publish_date() const { return publish_date_; }
void set_publish_date(const base::Time& publish_date) {
publish_date_ = publish_date;
« no previous file with comments | « components/ntp_snippets/DEPS ('k') | components/ntp_snippets/ntp_snippet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698