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

Unified Diff: components/ntp_snippets/content_suggestion.h

Issue 2102023002: Add ContentSuggestionsService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add explicit cast from ContentSuggestionsCategory to int Created 4 years, 5 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/BUILD.gn ('k') | components/ntp_snippets/content_suggestion.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/content_suggestion.h
diff --git a/components/ntp_snippets/content_suggestion.h b/components/ntp_snippets/content_suggestion.h
index 60ab27285d39153f84cbc3440fa5346646f6a7d5..f187b337085875802eb40dd75f89d6875c1cfd09 100644
--- a/components/ntp_snippets/content_suggestion.h
+++ b/components/ntp_snippets/content_suggestion.h
@@ -11,8 +11,6 @@
#include "base/macros.h"
#include "base/time/time.h"
-#include "components/ntp_snippets/content_suggestion_category.h"
-#include "components/ntp_snippets/content_suggestions_provider_type.h"
#include "url/gurl.h"
namespace ntp_snippets {
@@ -23,24 +21,18 @@ namespace ntp_snippets {
// (see ntp_snippet.h).
class ContentSuggestion {
public:
+ // Creates a new ContentSuggestion. The caller must ensure that the |id|
+ // passed in here is unique application-wide.
ContentSuggestion(const std::string& id,
- const ContentSuggestionsProviderType provider,
- const ContentSuggestionCategory category,
const GURL& url);
+ ContentSuggestion(ContentSuggestion&&);
+ ContentSuggestion& operator=(ContentSuggestion&&);
~ContentSuggestion();
- // An ID for identifying the suggestion. The ID is unique among all
- // suggestions from the same provider, so to determine a globally unique
- // identifier, combine this ID with the provider type.
+ // An ID for identifying the suggestion. The ID is unique application-wide.
const std::string& id() const { return id_; }
- // The provider that created this suggestion.
- ContentSuggestionsProviderType provider() const { return provider_; }
-
- // The category that this suggestion belongs to.
- ContentSuggestionCategory category() const { return category_; }
-
// The normal content URL where the content referenced by the suggestion can
// be accessed.
const GURL& url() const { return url_; }
@@ -72,7 +64,7 @@ class ContentSuggestion {
publisher_name_ = publisher_name;
}
- // TODO(pke) Remove the score from the ContentSuggestion class. The UI only
+ // TODO(pke): Remove the score from the ContentSuggestion class. The UI only
// uses it to track user clicks (histogram data). Instead, the providers
// should be informed about clicks and do appropriate logging themselves.
// IMPORTANT: The score may simply be 0 for suggestions from providers which
@@ -82,8 +74,6 @@ class ContentSuggestion {
private:
std::string id_;
- ContentSuggestionsProviderType provider_;
- ContentSuggestionCategory category_;
GURL url_;
GURL amp_url_;
std::string title_;
« no previous file with comments | « components/ntp_snippets/BUILD.gn ('k') | components/ntp_snippets/content_suggestion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698