Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java |
| index 3dd097aa81d12ffa1696d0ceabe84429b486e65e..4b3c70b17d7471294af6ec6a7eb01c9e2b47bc6c 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java |
| @@ -47,6 +47,10 @@ public class ChromeBackgroundService extends GcmTaskService { |
| handleFetchSnippets(context); |
| break; |
| + case SnippetsLauncher.TASK_TAG_RESCHEDULE: |
| + handleRescheduleSnippets(context); |
| + break; |
| + |
| case PrecacheController.PERIODIC_TASK_TAG: |
| case PrecacheController.CONTINUATION_TASK_TAG: |
| handlePrecache(context, params.getTag()); |
| @@ -85,6 +89,18 @@ public class ChromeBackgroundService extends GcmTaskService { |
| SnippetsBridge.fetchSnippets(); |
| } |
| + private void handleRescheduleSnippets(Context context) { |
| + if (!SnippetsLauncher.hasInstance()) { |
| + launchBrowser(context); |
| + } |
| + rescheduleSnippets(); |
|
Bernhard Bauer
2016/04/11 13:00:58
I'm not very happy about the fact that we launch t
Marc Treib
2016/04/11 13:25:26
Hm. Possible, sure, but it'd mean moving most of t
|
| + } |
| + |
| + @VisibleForTesting |
| + protected void rescheduleSnippets() { |
| + SnippetsBridge.rescheduleFetching(); |
| + } |
| + |
| private void handlePrecache(Context context, String tag) { |
| if (!hasPrecacheInstance()) { |
| launchBrowser(context); |