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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.h

Issue 1974483002: Allow getting _only_ personalized snippets for NTP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: After code review #2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 533f557d4981371ece78766c01950792cede9387..076a56bb813af818961a7351142cbc829a47a55b 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.h
+++ b/components/ntp_snippets/ntp_snippets_fetcher.h
@@ -56,6 +56,7 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
enum class FetchResult {
SUCCESS,
EMPTY_HOSTS,
+ OAUTH_TOKEN_ERROR,
URL_REQUEST_STATUS_ERROR,
HTTP_ERROR,
JSON_PARSE_ERROR,
@@ -99,7 +100,7 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
}
private:
- enum class Variant { kRestrictedPersonalized, kRestricted, kPersonalized };
+ enum class Personalization { kPersonal, kNonPersonal, kBoth };
void FetchSnippetsImpl(const GURL& url,
const std::string& auth_header,
@@ -163,8 +164,10 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
// Flag for picking the right (stable/non-stable) API key for Chrome Reader.
bool is_stable_channel_;
- // The variant of the fetching to use.
- Variant variant_;
+ // The variant of the fetching to use, loaded from variation parameters.
+ Personalization personalization_;
+ // Should we apply host restriction? It is loaded from variation parameters.
+ bool use_host_restriction_;
// Allow for an injectable tick clock for testing.
std::unique_ptr<base::TickClock> tick_clock_;
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698