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

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

Issue 2879583002: Custom Tabs: disable all speculation if third party cookies are blocked. (Closed)
Patch Set: Removed dead code from test copy-paste. Created 3 years, 7 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/customtabs/CustomTabActivityTest.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/customtabs/CustomTabsConnection.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
index 5c7244fc705f548429b12c4f3eb06089760b7440..0e71b3ea77e622d1756d6bca214cac7c0d676f32 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -952,12 +952,15 @@ public class CustomTabsConnection {
});
}
- private boolean maySpeculate(CustomTabsSessionToken session) {
+ @VisibleForTesting
+ boolean maySpeculate(CustomTabsSessionToken session) {
if (!DeviceClassManager.enablePrerendering()) return false;
+ PrefServiceBridge prefs = PrefServiceBridge.getInstance();
+ if (prefs.isBlockThirdPartyCookiesEnabled()) return false;
// TODO(yusufo): The check for prerender in PrivacyManager now checks for the network
// connection type as well, we should either change that or add another check for custom
// tabs. Then PrivacyManager should be used to make the below check.
- if (!PrefServiceBridge.getInstance().getNetworkPredictionEnabled()) return false;
+ if (!prefs.getNetworkPredictionEnabled()) return false;
if (DataReductionProxySettings.getInstance().isDataReductionProxyEnabled()) return false;
ConnectivityManager cm =
(ConnectivityManager) mApplication.getApplicationContext().getSystemService(
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698