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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java

Issue 2557363002: [NTP Snippets] Refactor background scheduling for remote suggestions (Closed)
Patch Set: Fixing the last changes :) Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/android/ntp/ntp_snippets_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
index a3cbb6d98b4508004673a4fd8c2241afae37e8a3..40364ba072b9a2b33d74887057ac8655fbe7a81e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
@@ -69,17 +69,19 @@ public class SnippetsBridge implements SuggestionsSource {
* Reschedules the fetching of snippets.
*/
public static void rescheduleFetching() {
- nativeRescheduleFetching();
+ nativeRemoteSuggestionsSchedulerRescheduleFetching();
}
+ /**
+ * Fetches remote suggestions in background.
+ */
public static void fetchRemoteSuggestionsFromBackground() {
- // Do not force regular background fetches.
- nativeFetchRemoteSuggestionsInTheBackground();
+ nativeRemoteSuggestionsSchedulerOnFetchDue();
}
@Override
public void fetchRemoteSuggestions() {
- nativeFetchRemoteSuggestions();
+ nativeReloadSuggestions(mNativeSnippetsBridge);
}
@Override
@@ -271,9 +273,9 @@ public class SnippetsBridge implements SuggestionsSource {
private native long nativeInit(Profile profile);
private native void nativeDestroy(long nativeNTPSnippetsBridge);
- private static native void nativeFetchRemoteSuggestions();
- private static native void nativeFetchRemoteSuggestionsInTheBackground();
- private static native void nativeRescheduleFetching();
+ private native void nativeReloadSuggestions(long nativeNTPSnippetsBridge);
+ private static native void nativeRemoteSuggestionsSchedulerOnFetchDue();
+ private static native void nativeRemoteSuggestionsSchedulerRescheduleFetching();
private native int[] nativeGetCategories(long nativeNTPSnippetsBridge);
private native int nativeGetCategoryStatus(long nativeNTPSnippetsBridge, int category);
private native SuggestionsCategoryInfo nativeGetCategoryInfo(
« no previous file with comments | « no previous file | chrome/browser/android/ntp/ntp_snippets_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698