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

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

Issue 2202423004: [Offline Page]Enable share offline page from online tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newBranchOnTryout
Patch Set: Patch to land Created 4 years, 4 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
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 0a6ace7bfd373b6ab91197e5557a3042f4a6a17a..feb75b4f75df177314d6832979230bf2d517f583 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
@@ -26,6 +26,7 @@ import java.util.UUID;
@JNINamespace("offline_pages::android")
public class OfflinePageBridge {
public static final String BOOKMARK_NAMESPACE = "bookmark";
+ public static final String SHARE_NAMESPACE = "share";
/**
* Retrieves the OfflinePageBridge for the given profile, creating it the first time
@@ -271,6 +272,24 @@ public class OfflinePageBridge {
}
/**
+ * Get the offline page associated with the provided offline ID.
+ *
+ * @param offlineId ID of the offline page.
+ * @param callback callback to pass back the
+ * matching {@link OfflinePageItem} if found. Will pass back <code>null</code> if not.
+ */
+ public void getPageByOfflineId(final long offlineId, final Callback<OfflinePageItem> callback) {
+ runWhenLoaded(new Runnable() {
+ @Override
+ public void run() {
+ OfflinePageItem item =
+ nativeGetPageByOfflineId(mNativeOfflinePageBridge, offlineId);
+ callback.onResult(item);
+ }
+ });
+ }
+
+ /**
* Saves the web page loaded into web contents offline.
*
* @param webContents Contents of the page to save.

Powered by Google App Engine
This is Rietveld 408576698