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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java

Issue 1767243002: Update prerender policy for custom tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indentation 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
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
index 5624ca48b2a96f94ba86fa9042fe5946de87a459..d6e4121c833bd2367da26d1cb6b9ab34aa12e041 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/ClientManager.java
@@ -54,6 +54,7 @@ class ClientManager {
public final IBinder.DeathRecipient deathRecipient;
public boolean mIgnoreFragments;
private boolean mShouldHideDomain;
+ private boolean mShouldPrerenderOnMobile;
private ServiceConnection mKeepAliveConnection;
private String mPredictedUrl;
private long mLastMayLaunchUrlTimestamp;
@@ -273,6 +274,22 @@ class ClientManager {
params.mIgnoreFragments = value;
}
+ /**
+ * @return Whether prerender should be turned on for mobile networks for given session.
+ */
+ public synchronized boolean shouldPrerenderOnMobileForSession(IBinder session) {
+ SessionParams params = mSessionParams.get(session);
+ return params != null ? params.mShouldPrerenderOnMobile : false;
+ }
+
+ /**
+ * Sets whether prerender should be turned on for mobile networks for given session.
+ */
+ public synchronized void setPrerenderOnMobileForSession(IBinder session, boolean prerender) {
+ SessionParams params = mSessionParams.get(session);
+ if (params != null) params.mShouldPrerenderOnMobile = prerender;
gone 2016/03/09 23:02:14 should setIgnoreFragmentsForSession also check if
Yusuf 2016/03/09 23:22:49 Done.
+ }
+
/** Tries to bind to a client to keep it alive, and returns true for success. */
public synchronized boolean keepAliveForSession(IBinder session, Intent intent) {
// When an application is bound to a service, its priority is raised to

Powered by Google App Engine
This is Rietveld 408576698