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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java

Issue 2187033002: [Offline Pages] Make querying by client ID support a list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 months 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/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java » ('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/offlinepages/OfflinePageBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
index 944e51218c8fb69e7e676b935b5ce7991661945f..eb2cabeff0be44eac7f537d0cc423a278f854395 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
@@ -211,19 +211,23 @@ public class OfflinePageBridge {
}
/**
- * Gets the offline pages associated with a provided client ID.
+ * Gets the offline pages associated with the provided client IDs.
*
- * @param clientId Client's ID associated with an offline page.
- * @return A {@link OfflinePageItem} matching the bookmark Id or <code>null</code> if none
+ * @param clientIds Client's IDs associated with offline pages.
+ * @return A list of {@link OfflinePageItem} matching the provided IDs, or an empty list if none
* exist.
*/
@VisibleForTesting
- public void getPagesByClientId(
- final ClientId clientId, final Callback<List<OfflinePageItem>> callback) {
+ public void getPagesByClientIds(
+ final List<ClientId> clientIds, final Callback<List<OfflinePageItem>> callback) {
runWhenLoaded(new Runnable() {
@Override
public void run() {
- callback.onResult(getPagesByClientIdInternal(clientId));
+ List<OfflinePageItem> result = new ArrayList<>();
+ for (ClientId clientId : clientIds) {
+ result.addAll(getPagesByClientIdInternal(clientId));
+ }
+ callback.onResult(result);
}
});
}
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698