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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 1863213004: [NTP Snippets] Cleanup: remove NTPSnippetsService::is_loaded() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove now-pointless tests Created 4 years, 8 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 b03d0488a29a2bf0a8e1aa985bea6066d9d68813..5f6fa58f5c9ad89063ed08875224c7ddc6f6360f 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -122,7 +122,6 @@ NTPSnippetsService::NTPSnippetsService(
const ParseJSONCallback& parse_json_callback)
: pref_service_(pref_service),
suggestions_service_(suggestions_service),
- loaded_(false),
file_task_runner_(file_task_runner),
application_language_code_(application_language_code),
scheduler_(scheduler),
@@ -175,7 +174,6 @@ void NTPSnippetsService::Init(bool enabled) {
void NTPSnippetsService::Shutdown() {
FOR_EACH_OBSERVER(NTPSnippetsServiceObserver, observers_,
NTPSnippetsServiceShutdown(this));
- loaded_ = false;
}
void NTPSnippetsService::FetchSnippets() {
@@ -203,8 +201,7 @@ bool NTPSnippetsService::DiscardSnippet(const GURL& url) {
void NTPSnippetsService::AddObserver(NTPSnippetsServiceObserver* observer) {
observers_.AddObserver(observer);
- if (loaded_)
- observer->NTPSnippetsServiceLoaded(this);
+ observer->NTPSnippetsServiceLoaded(this);
}
void NTPSnippetsService::RemoveObserver(NTPSnippetsServiceObserver* observer) {
@@ -305,7 +302,6 @@ bool NTPSnippetsService::LoadFromListValue(const base::ListValue& list) {
else
snippets_.push_back(std::move(snippet));
}
- loaded_ = true;
// Immediately remove any already-expired snippets. This will also notify our
// observers and schedule the expiry timer.
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service.h ('k') | components/ntp_snippets/ntp_snippets_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698