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

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

Issue 2684973014: Only show Last N Pages in the UI when the corresponding tab is visible. (Closed)
Patch Set: Move impl out Created 3 years, 10 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 f2f42ff68774c0cc1a37078937f4566e626962bc..fd99d14e1dc8091e7f3710431cab16d6eeb51afd 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.Set;
public class OfflinePageBridge {
public static final String ASYNC_NAMESPACE = "async_loading";
public static final String BOOKMARK_NAMESPACE = "bookmark";
+ public static final String LAST_N_NAMESPACE = "last_n";
public static final String SHARE_NAMESPACE = "share";
/**
@@ -435,6 +436,16 @@ public class OfflinePageBridge {
nativeCheckPagesExistOffline(mNativeOfflinePageBridge, urlArray, callbackInternal);
}
+ /** Tells the native side that a new tab has been added for this profile. */
+ void registerRecentTab(int tabId) {
+ nativeRegisterRecentTab(mNativeOfflinePageBridge, tabId);
+ }
+
+ /** Tells the native side that a new tab has been removed for this profile. */
+ void unregisterRecentTab(int tabId) {
+ nativeUnregisterRecentTab(mNativeOfflinePageBridge, tabId);
+ }
+
@VisibleForTesting
static void setOfflineBookmarksEnabledForTesting(boolean enabled) {
sOfflineBookmarksEnabled = enabled;
@@ -502,12 +513,13 @@ public class OfflinePageBridge {
private static native boolean nativeIsPageSharingEnabled();
private static native boolean nativeCanSavePage(String url);
private static native OfflinePageBridge nativeGetOfflinePageBridgeForProfile(Profile profile);
-
@VisibleForTesting
native void nativeGetAllPages(long nativeOfflinePageBridge, List<OfflinePageItem> offlinePages,
final Callback<List<OfflinePageItem>> callback);
private native void nativeCheckPagesExistOffline(long nativeOfflinePageBridge, Object[] urls,
CheckPagesExistOfflineCallbackInternal callback);
+ private native void nativeRegisterRecentTab(long nativeOfflinePageBridge, int tabId);
+ private native void nativeUnregisterRecentTab(long nativeOfflinePageBridge, int tabId);
@VisibleForTesting
native void nativeGetRequestsInQueue(
long nativeOfflinePageBridge, Callback<SavePageRequest[]> callback);

Powered by Google App Engine
This is Rietveld 408576698