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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.cc

Issue 1978513002: Getting the personalization info in chrome://snippets-internals correct. (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 | « components/ntp_snippets/ntp_snippets_fetcher.h ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_fetcher.cc
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.cc b/components/ntp_snippets/ntp_snippets_fetcher.cc
index cdec1c3075041fe3b28eb6ca4493bd459b6b7e81..b7786e57eb9d7932041cb72a9e6b14188e915729 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.cc
+++ b/components/ntp_snippets/ntp_snippets_fetcher.cc
@@ -201,7 +201,7 @@ void NTPSnippetsFetcher::FetchSnippetsFromHosts(
hosts_ = hosts;
fetch_start_time_ = tick_clock_->NowTicks();
- if (UseHostRestriction() && hosts_.empty()) {
+ if (UsesHostRestrictions() && hosts_.empty()) {
FetchFinished(OptionalSnippets(), FetchResult::EMPTY_HOSTS,
/*extra_message=*/std::string());
return;
@@ -218,7 +218,7 @@ void NTPSnippetsFetcher::FetchSnippetsFromHosts(
count_to_fetch_ = count;
- bool use_authentication = UseAuthentication();
+ bool use_authentication = UsesAuthentication();
if (use_authentication && signin_manager_->IsAuthenticated()) {
// Signed-in: get OAuth token --> fetch snippets.
@@ -264,7 +264,7 @@ void NTPSnippetsFetcher::FetchSnippetsImpl(const GURL& url,
std::string NTPSnippetsFetcher::GetHostRestricts() const {
std::string host_restricts;
- if (UseHostRestriction()) {
+ if (UsesHostRestrictions()) {
for (const std::string& host : hosts_) {
if (!host_restricts.empty())
host_restricts.push_back(',');
@@ -274,13 +274,13 @@ std::string NTPSnippetsFetcher::GetHostRestricts() const {
return host_restricts;
}
-bool NTPSnippetsFetcher::UseHostRestriction() const {
+bool NTPSnippetsFetcher::UsesHostRestrictions() const {
return use_host_restriction_ &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDontRestrict);
}
-bool NTPSnippetsFetcher::UseAuthentication() const {
+bool NTPSnippetsFetcher::UsesAuthentication() const {
return (personalization_ == Personalization::kPersonal ||
personalization_ == Personalization::kBoth);
}
« no previous file with comments | « components/ntp_snippets/ntp_snippets_fetcher.h ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698