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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 2061803002: 📰 The Status card reports disabled sync states (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplifyBridge
Patch Set: [NTP Snippets] The Status card reports disabled sync states Created 4 years, 6 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 040c1c82c926f186caa88dfb4c7ff668ed2a6d8f..df529bb9686185623e26cccc3693fc2bae320d3e 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -658,13 +658,6 @@ void NTPSnippetsService::FinishInitialization() {
FOR_EACH_OBSERVER(NTPSnippetsServiceObserver, observers_,
NTPSnippetsServiceLoaded());
-
- // Start a fetch if we don't have any snippets yet, or a fetch was requested
- // earlier.
- if (ready() && (snippets_.empty() || fetch_after_load_)) {
dgn 2016/06/13 17:27:15 redundant, if we transition to ready, we have the
- fetch_after_load_ = false;
- FetchSnippets();
- }
}
NTPSnippetsService::State NTPSnippetsService::GetStateForDependenciesStatus() {
@@ -705,7 +698,7 @@ void NTPSnippetsService::EnterState(State state) {
// If the service was previously disabled, we will need to start a fetch
// because otherwise there won't be any.
- bool fetch_snippets = state_ == State::DISABLED || fetch_after_load_;
+ bool fetch_snippets = snippets_.empty() || fetch_after_load_;
DVLOG(1) << "Entering state: READY";
state_ = State::READY;
fetch_after_load_ = false;

Powered by Google App Engine
This is Rietveld 408576698