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

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

Issue 1869323003: [NTP Snippets] Scheduler: Fetch on Wifi (without charging) only 6AM-10PM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_merge_controller
Patch Set: remove fudge 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 b1154ceb7fe7c429fdbc60cd003f62fc899a03ac..3acbd247bc630af1759dd17f09a260b72484daa6 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -36,6 +36,14 @@ static void FetchSnippets(JNIEnv* env,
NTPSnippetsServiceFactory::GetForProfile(profile)->FetchSnippets();
}
+// Reschedules the fetching of snippets. Used to support different fetching
+// intervals for different times of day.
+static void RescheduleFetching(JNIEnv* env,
+ const JavaParamRef<jclass>& caller) {
+ Profile* profile = ProfileManager::GetLastUsedProfile();
+ NTPSnippetsServiceFactory::GetForProfile(profile)->RescheduleFetching();
+}
+
NTPSnippetsBridge::NTPSnippetsBridge(JNIEnv* env,
const JavaParamRef<jobject>& j_profile)
: snippet_service_observer_(this) {

Powered by Google App Engine
This is Rietveld 408576698