| 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 c73a50882369eb3302a88bb0ab1ab7661389af6d..8c09c2a4d51bd8ba7455415f6c40af00fd05c976 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
|
| @@ -19,6 +19,8 @@ import java.util.HashSet;
|
| import java.util.List;
|
| import java.util.Set;
|
|
|
| +import javax.annotation.Nullable;
|
| +
|
| /**
|
| * Access gate to C++ side offline pages functionalities.
|
| */
|
| @@ -468,6 +470,25 @@ public class OfflinePageBridge {
|
| nativeScheduleDownload(mNativeOfflinePageBridge, webContents, nameSpace, url, uiAction);
|
| }
|
|
|
| + /**
|
| + * Checks if an offline page is shown for the webContents.
|
| + * @param webContents Web contents used to find the offline page.
|
| + * @return True if the offline page is opened.
|
| + */
|
| + public boolean isOfflinePage(WebContents webContents) {
|
| + return nativeIsOfflinePage(mNativeOfflinePageBridge, webContents);
|
| + }
|
| +
|
| + /**
|
| + * Retrieves the offline page that is shown for the tab.
|
| + * @param webContents Web contents used to find the offline page.
|
| + * @return The offline page if tab currently displays it, null otherwise.
|
| + */
|
| + @Nullable
|
| + public OfflinePageItem getOfflinePage(WebContents webContents) {
|
| + return nativeGetOfflinePage(mNativeOfflinePageBridge, webContents);
|
| + }
|
| +
|
| @VisibleForTesting
|
| static void setOfflineBookmarksEnabledForTesting(boolean enabled) {
|
| sOfflineBookmarksEnabled = enabled;
|
| @@ -573,4 +594,8 @@ public class OfflinePageBridge {
|
| long nativeOfflinePageBridge, WebContents webContents);
|
| private native void nativeScheduleDownload(long nativeOfflinePageBridge,
|
| WebContents webContents, String nameSpace, String url, int uiAction);
|
| + private native boolean nativeIsOfflinePage(
|
| + long nativeOfflinePageBridge, WebContents webContents);
|
| + private native OfflinePageItem nativeGetOfflinePage(
|
| + long nativeOfflinePageBridge, WebContents webContents);
|
| }
|
|
|