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

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

Issue 2706343007: Only show Last N Pages in the UI when the corresponding tab is visible. (cont'd) (Closed)
Patch Set: Rebase. 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 16e4ce0e4c4db9ca1532f5d8f07d77cec6063068..676c39ff27278d77419f5460852771b17acc17f0 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
@@ -439,6 +439,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;
@@ -506,12 +516,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