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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

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: Fixing related API changes 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
Index: components/ntp_snippets/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index 02524508ceca77bf9620436e54bc6604c47ab25e..589a77772989ac62adddaccf66b641814c92dc84 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -186,7 +186,7 @@ void NTPSnippetsService::Init(bool enabled) {
enabled_ = enabled;
if (enabled_) {
// |suggestions_service_| can be null in tests.
- if (suggestions_service_) {
+ if (snippets_fetcher_->UseHostRestriction() && suggestions_service_) {
suggestions_service_subscription_ = suggestions_service_->AddCallback(
base::Bind(&NTPSnippetsService::OnSuggestionsChanged,
base::Unretained(this)));

Powered by Google App Engine
This is Rietveld 408576698