| 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 cf3612c9c78aba4a0a55e6990f2563ce3ce8326a..4525f1f16c2e94dfe3fea99fd0b3a160d8efecb0 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
|
| @@ -179,6 +179,16 @@ public class SnippetsBridge implements SuggestionsSource {
|
| nativeOnNTPInitialized(mNativeSnippetsBridge);
|
| }
|
|
|
| + public static void notifySchedulerAboutWarmResume() {
|
| + SnippetsBridge snippetsBridge = new SnippetsBridge(Profile.getLastUsedProfile());
|
| + snippetsBridge.onActivityWarmResumed();
|
| + }
|
| +
|
| + public static void notifySchedulerAboutColdStart() {
|
| + SnippetsBridge snippetsBridge = new SnippetsBridge(Profile.getLastUsedProfile());
|
| + snippetsBridge.onColdStart();
|
| + }
|
| +
|
| public static void onSuggestionTargetVisited(int category, long visitTimeMs) {
|
| nativeOnSuggestionTargetVisited(category, visitTimeMs);
|
| }
|
| @@ -202,6 +212,16 @@ public class SnippetsBridge implements SuggestionsSource {
|
| nativeFetch(mNativeSnippetsBridge, category, displayedSuggestionIds);
|
| }
|
|
|
| + private void onActivityWarmResumed() {
|
| + assert mNativeSnippetsBridge != 0;
|
| + nativeOnActivityWarmResumed(mNativeSnippetsBridge);
|
| + }
|
| +
|
| + private void onColdStart() {
|
| + assert mNativeSnippetsBridge != 0;
|
| + nativeOnColdStart(mNativeSnippetsBridge);
|
| + }
|
| +
|
| @CalledByNative
|
| private static List<SnippetArticle> createSuggestionList() {
|
| return new ArrayList<>();
|
| @@ -302,6 +322,8 @@ public class SnippetsBridge implements SuggestionsSource {
|
| long nativeNTPSnippetsBridge, int category, int position);
|
| private native void nativeOnMoreButtonClicked(
|
| long nativeNTPSnippetsBridge, int category, int position);
|
| + private native void nativeOnActivityWarmResumed(long nativeNTPSnippetsBridge);
|
| + private native void nativeOnColdStart(long nativeNTPSnippetsBridge);
|
| private static native void nativeOnSuggestionTargetVisited(int category, long visitTimeMs);
|
| private static native void nativeOnNTPInitialized(long nativeNTPSnippetsBridge);
|
| }
|
|
|