Index: components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/OfflineContentProvider.java |
diff --git a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/OfflineContentProvider.java b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/OfflineContentProvider.java |
index 7c177a7d4b014cf882a2005720ee3b434f0be93c..99bb6525909832a394fa537f6c206b6d3343f567 100644 |
--- a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/OfflineContentProvider.java |
+++ b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/OfflineContentProvider.java |
@@ -4,6 +4,8 @@ |
package org.chromium.components.offline_items_collection; |
+import android.support.annotation.Nullable; |
+ |
import java.util.ArrayList; |
/** |
@@ -11,7 +13,20 @@ import java.util.ArrayList; |
* (components/offline_items_collection/core/offline_content_provider.h) class. |
*/ |
public interface OfflineContentProvider { |
- /** This interface is a Java counterpart to the C++ OfflineContentProvider::Observer |
+ /** |
+ * This interface is a Java counterpart to the C++ base::Callback meant to be used in response |
+ * to {@link OfflineItemVisuals} requests. |
+ */ |
+ interface VisualsCallback { |
+ /** |
+ * @param id The {@link ContentId} that {@code visuals} is associated with. |
+ * @param visuals The {@link OfflineItemVisuals}, if any, associated with {@code id}. |
+ */ |
+ void onVisualsAvailable(ContentId id, @Nullable OfflineItemVisuals visuals); |
+ } |
+ |
+ /** |
+ * This interface is a Java counterpart to the C++ OfflineContentProvider::Observer |
* (components/offline_items_collection/core/offline_content_provider.h) class. |
*/ |
interface Observer { |
@@ -52,6 +67,9 @@ public interface OfflineContentProvider { |
/** See OfflineContentProvider::GetAllItems(). */ |
ArrayList<OfflineItem> getAllItems(); |
+ /** See OfflineContentProvider::GetVisualsForItem(...). */ |
+ void getVisualsForItem(ContentId id, VisualsCallback callback); |
+ |
/** See OfflineContentProvider::AddObserver(...). */ |
void addObserver(Observer observer); |