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

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

Issue 1772233003: Flag for Background Loading of Offline Pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put @VisibleForTesting in the right place. Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35fbafb89c0a330788923e17673335ec6706dee5..52c5f6a21ab36243f54521efb1a88bee7df8f81d 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
@@ -8,9 +8,11 @@ import android.os.AsyncTask;
import org.chromium.base.ObserverList;
import org.chromium.base.ThreadUtils;
+import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.metrics.RecordHistogram;
+import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.components.offlinepages.DeletePageResult;
import org.chromium.components.offlinepages.FeatureMode;
@@ -29,6 +31,8 @@ import java.util.Set;
public class OfflinePageBridge {
public static final String BOOKMARK_NAMESPACE = "bookmark";
public static final long INVALID_OFFLINE_ID = 0;
+ private static final String OFFLINE_PAGES_BACKGROUND_LOADING_FEATURE_NAME =
+ "offline-pages-background-loading";
/**
* Retrieves the OfflinePageBridge for the given profile, creating it the first time
@@ -189,6 +193,15 @@ public class OfflinePageBridge {
}
/**
+ * @return True if the offline pages feature is enabled, regardless whether bookmark or saved
+ * page shown in UI strings.
+ */
+ @VisibleForTesting
+ public static boolean isBackgroundLoadingEnabled() {
+ return ChromeFeatureList.isEnabled(OFFLINE_PAGES_BACKGROUND_LOADING_FEATURE_NAME);
+ }
+
+ /**
* @return True if an offline copy of the given URL can be saved.
*/
public static boolean canSavePage(String url) {
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698