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

Side by Side Diff: components/ntp_snippets/ntp_snippet.h

Issue 1992803002: Use multiple IDs when discarding or merging snippets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_ 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // |snippets|. Returns true on success, false if anything went wrong. 50 // |snippets|. Returns true on success, false if anything went wrong.
51 static bool AddFromListValue(const base::ListValue& list, 51 static bool AddFromListValue(const base::ListValue& list,
52 PtrVector* snippets); 52 PtrVector* snippets);
53 53
54 std::unique_ptr<base::DictionaryValue> ToDictionary() const; 54 std::unique_ptr<base::DictionaryValue> ToDictionary() const;
55 55
56 // A unique ID for identifying the snippet. If initialized by 56 // A unique ID for identifying the snippet. If initialized by
57 // CreateFromDictionary() the relevant key is 'url'. 57 // CreateFromDictionary() the relevant key is 'url'.
58 // TODO(treib): For now, the ID has to be a valid URL spec, otherwise 58 // TODO(treib): For now, the ID has to be a valid URL spec, otherwise
59 // fetching the salient image will fail. See TODO in ntp_snippets_service.cc. 59 // fetching the salient image will fail. See TODO in ntp_snippets_service.cc.
60 // TODO(tschumann): With the new data layout based on the zine backend service
61 // protos, we should distinguish between an ID (should only be used by the JNI
62 // bridge) and a URL (used by snipets internal page etc.).
Marc Treib 2016/05/18 15:19:33 Not quite sure how to read this comment... we alre
tschumann 2016/05/18 17:09:16 IMO we should properly distinguish the ID from URL
Marc Treib 2016/05/18 18:58:05 IMO the internals page should show everything we h
tschumann 2016/05/18 19:23:28 Removed the comment. As it's not too clear as of t
60 const std::string& id() const { return id_; } 63 const std::string& id() const { return id_; }
61 64
62 // Title of the snippet. 65 // Title of the snippet.
63 const std::string& title() const { return title_; } 66 const std::string& title() const { return title_; }
64 void set_title(const std::string& title) { title_ = title; } 67 void set_title(const std::string& title) { title_ = title; }
65 68
66 // Summary or relevant extract from the content. 69 // Summary or relevant extract from the content.
67 const std::string& snippet() const { return snippet_; } 70 const std::string& snippet() const { return snippet_; }
68 void set_snippet(const std::string& snippet) { snippet_ = snippet; } 71 void set_snippet(const std::string& snippet) { snippet_ = snippet; }
69 72
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 size_t best_source_index_; 130 size_t best_source_index_;
128 131
129 std::vector<SnippetSource> sources_; 132 std::vector<SnippetSource> sources_;
130 133
131 DISALLOW_COPY_AND_ASSIGN(NTPSnippet); 134 DISALLOW_COPY_AND_ASSIGN(NTPSnippet);
132 }; 135 };
133 136
134 } // namespace ntp_snippets 137 } // namespace ntp_snippets
135 138
136 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_ 139 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.cc » ('j') | components/ntp_snippets/ntp_snippets_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698