| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.offlinepages; | 5 package org.chromium.chrome.browser.offlinepages; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Bundle; | 8 import android.os.Bundle; |
| 9 | 9 |
| 10 import com.google.android.gms.gcm.GcmNetworkManager; | 10 import com.google.android.gms.gcm.GcmNetworkManager; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 .setExtras(taskExtras) | 42 .setExtras(taskExtras) |
| 43 .build(); | 43 .build(); |
| 44 | 44 |
| 45 gcmNetworkManager.schedule(task); | 45 gcmNetworkManager.schedule(task); |
| 46 } | 46 } |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Cancel any outstanding GCM Network Manager requests. | 49 * Cancel any outstanding GCM Network Manager requests. |
| 50 */ | 50 */ |
| 51 public static void unschedule(Context context) { | 51 public static void unschedule(Context context) { |
| 52 // TODO(petewil): Take our task off the task queue. | 52 // Get the GCM Network Scheduler. |
| 53 GcmNetworkManager gcmNetworkManager = GcmNetworkManager.getInstance(cont
ext); |
| 54 gcmNetworkManager.cancelTask(OfflinePageUtils.TASK_TAG, ChromeBackground
Service.class); |
| 53 } | 55 } |
| 54 } | 56 } |
| OLD | NEW |