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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.h

Issue 2274953002: Inform server of dismissed articles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: JSON comma. Created 4 years, 4 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
Index: components/ntp_snippets/ntp_snippets_fetcher.h
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.h b/components/ntp_snippets/ntp_snippets_fetcher.h
index 33f6c180ff2cc205d0bee64c7cfe6b7c2af5d015..fb938f6e77c46cf7def29fba881889d844a876d9 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.h
+++ b/components/ntp_snippets/ntp_snippets_fetcher.h
@@ -90,7 +90,11 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
void SetCallback(const SnippetsAvailableCallback& callback);
// Fetches snippets from the server. |hosts| restricts the results to a set of
- // hosts, e.g. "www.google.com". An empty host set produces an error.
+ // hosts, e.g. "www.google.com". If host restrictions are enabled, en empty
Marc Treib 2016/08/25 11:41:44 s/en/an/
sfiera 2016/08/25 11:58:07 Done.
+ // host set produces an error without issuing a fetch.
+ //
+ // |excluded_ids| will be reported to the server; the server should not return
+ // suggestions with those IDs.
//
// If an ongoing fetch exists, it will be cancelled and a new one started,
// without triggering an additional callback (i.e. not noticeable by
@@ -100,6 +104,7 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
// |interactive_request| is set to true (use only for user-initiated fetches).
void FetchSnippetsFromHosts(const std::set<std::string>& hosts,
const std::string& language_code,
+ const std::set<std::string>& excluded_ids,
int count,
bool interactive_request);
@@ -134,6 +139,7 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
private:
FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest, BuildRequestAuthenticated);
FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest, BuildRequestUnauthenticated);
+ FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest, BuildRequestExcludedIds);
enum FetchAPI {
CHROME_READER_API,
@@ -146,6 +152,7 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
bool only_return_personalized_results;
std::string user_locale;
std::set<std::string> host_restricts;
+ std::set<std::string> excluded_ids;
int count_to_fetch;
RequestParams();
@@ -201,6 +208,9 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
// Hosts to restrict the snippets to.
std::set<std::string> hosts_;
+ // Snippets to exclude from the results.
+ std::set<std::string> excluded_ids_;
+
// Count of snippets to fetch.
int count_to_fetch_;
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.cc » ('j') | components/ntp_snippets/ntp_snippets_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698