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

Unified Diff: chrome/browser/android/ntp/ntp_snippets_bridge.cc

Issue 1897313002: Revert of [NTP Snippets] Refresh the displayed snippets less frequently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: chrome/browser/android/ntp/ntp_snippets_bridge.cc
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
index 89211d0d2b6f0483f8eac7bcf289ba92e9938af4..b1154ceb7fe7c429fdbc60cd003f62fc899a03ac 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -41,14 +41,14 @@
: snippet_service_observer_(this) {
Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile);
ntp_snippets_service_ = NTPSnippetsServiceFactory::GetForProfile(profile);
- snippet_service_observer_.Add(ntp_snippets_service_);
}
void NTPSnippetsBridge::SetObserver(JNIEnv* env,
const JavaParamRef<jobject>& obj,
const JavaParamRef<jobject>& j_observer) {
observer_.Reset(env, j_observer);
- NTPSnippetsServiceLoaded();
+ // This will call NTPSnippetsServiceLoaded.
+ snippet_service_observer_.Add(ntp_snippets_service_);
}
NTPSnippetsBridge::~NTPSnippetsBridge() {}
@@ -65,8 +65,7 @@
}
void NTPSnippetsBridge::NTPSnippetsServiceLoaded() {
- if (observer_.is_null())
- return;
+ DCHECK(!observer_.is_null());
std::vector<std::string> titles;
std::vector<std::string> urls;

Powered by Google App Engine
This is Rietveld 408576698