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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.h

Issue 1986173003: Fixes that host restriction was sometimes applied even when switched off. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fixes 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_service.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 b3cd393f8299607eef4b1c212d064b08e861c812..8bc982d8d99edc55cb0aa74243665d8ebb99659e 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.h
+++ b/components/ntp_snippets/ntp_snippets_fetcher.h
@@ -65,6 +65,9 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
RESULT_MAX
};
+ // Enum listing all possible variants of dealing with personalization.
+ enum class Personalization { kPersonal, kNonPersonal, kBoth };
+
NTPSnippetsFetcher(
SigninManagerBase* signin_manager,
OAuth2TokenService* oauth2_token_service,
@@ -95,20 +98,24 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
return last_fetch_json_;
}
+ // Returns the personalization setting of the fetcher.
+ Personalization personalization() const { return personalization_; }
+
+ // Does the fetcher use host restriction?
+ bool UseHostRestriction() const;
+ // Does the fetcher use authentication to get personalized results?
+ bool UseAuthentication() const;
+
// Overrides internal clock for testing purposes.
void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) {
tick_clock_ = std::move(tick_clock);
}
private:
- enum class Personalization { kPersonal, kNonPersonal, kBoth };
-
void FetchSnippetsImpl(const GURL& url,
const std::string& auth_header,
const std::string& request);
std::string GetHostRestricts() const;
- bool UseHostRestriction() const;
- bool UseAuthentication() const;
void FetchSnippetsNonAuthenticated();
void FetchSnippetsAuthenticated(const std::string& account_id,
const std::string& oauth_access_token);
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698