| Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| index 8c7a0e1a30e61278d30a044bbe176bf63a9ad68e..1dced8029edb9da52d7f6914942ec023e194b006 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| @@ -122,7 +122,7 @@ public class OfflinePageEvaluationBridge {
|
| }
|
|
|
| /**
|
| - * Force request coordinator to process the requests in the queue.
|
| + * Forces request coordinator to process the requests in the queue.
|
| * @param callback The callback would be invoked after the operation completes.
|
| * @return True if processing starts successfully and callback is expected to be called, false
|
| * otherwise.
|
| @@ -132,6 +132,27 @@ public class OfflinePageEvaluationBridge {
|
| }
|
|
|
| /**
|
| + * Gets all requests in the queue.
|
| + * @param callback The callback would be invoked with a list of requests which are in the queue.
|
| + */
|
| + public void getRequestsInQueue(Callback<SavePageRequest[]> callback) {
|
| + nativeGetRequestsInQueue(mNativeOfflinePageEvaluationBridge, callback);
|
| + }
|
| +
|
| + /**
|
| + * Removes requests from the queue by request ids.
|
| + * @param requestIds The list of request ids to be deleted.
|
| + * @param callback The callback would be invoked with number of successfully deleted ids.
|
| + */
|
| + public void removeRequestsFromQueue(List<Long> requestIds, Callback<Integer> callback) {
|
| + long[] ids = new long[requestIds.size()];
|
| + for (int i = 0; i < requestIds.size(); i++) {
|
| + ids[i] = requestIds.get(i);
|
| + }
|
| + nativeRemoveRequestsFromQueue(mNativeOfflinePageEvaluationBridge, ids, callback);
|
| + }
|
| +
|
| + /**
|
| * @return True if the offline page model has fully loaded.
|
| */
|
| public boolean isOfflinePageModelLoaded() {
|
| @@ -202,4 +223,8 @@ public class OfflinePageEvaluationBridge {
|
| String clientNamespace, String clientId, boolean userRequested);
|
| private native boolean nativePushRequestProcessing(
|
| long nativeOfflinePageEvaluationBridge, Callback<Boolean> callback);
|
| + private native void nativeGetRequestsInQueue(
|
| + long nativeOfflinePageEvaluationBridge, final Callback<SavePageRequest[]> callback);
|
| + private native void nativeRemoveRequestsFromQueue(long nativeOfflinePageEvaluationBridge,
|
| + long[] requestIds, final Callback<Integer> callback);
|
| }
|
|
|