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

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

Issue 2068393002: Flag for Offline Page Sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve merge conflict Created 4 years, 5 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 5416401ffcd8cb131956d6bc0097041d17bed2ff..944e51218c8fb69e7e676b935b5ce7991661945f 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
@@ -49,6 +49,7 @@ public class OfflinePageBridge {
/** Whether an offline sub-feature is enabled or not. */
private static Boolean sOfflineBookmarksEnabled;
private static Boolean sBackgroundLoadingEnabled;
+ private static Boolean sPageSharingEnabled;
/**
* Callback used when saving an offline page.
@@ -142,6 +143,18 @@ public class OfflinePageBridge {
}
/**
+ * @return True if offline pages sharing is enabled.
+ */
+ @VisibleForTesting
+ public static boolean isPageSharingEnabled() {
+ ThreadUtils.assertOnUiThread();
+ if (sPageSharingEnabled == null) {
+ sPageSharingEnabled = nativeIsPageSharingEnabled();
+ }
+ return sPageSharingEnabled;
+ }
+
+ /**
* @return True if an offline copy of the given URL can be saved.
*/
public static boolean canSavePage(String url) {
@@ -468,6 +481,7 @@ public class OfflinePageBridge {
private static native boolean nativeIsOfflinePagesEnabled();
private static native boolean nativeIsOfflineBookmarksEnabled();
private static native boolean nativeIsBackgroundLoadingEnabled();
+ private static native boolean nativeIsPageSharingEnabled();
private static native boolean nativeCanSavePage(String url);
private static native OfflinePageBridge nativeGetOfflinePageBridgeForProfile(Profile profile);
« 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