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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java

Issue 2957023002: Centralize the Data Reduction Proxy pass through header (Closed)
Patch Set: remove unused identity directive method Created 3 years, 6 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/tab/TabContextMenuItemDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
index 46ecd9adedbd97d859847a215170789fe769ebb1..42eaada4677ba44edef5826e8146757ae06e9771 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
@@ -37,9 +37,6 @@ import java.util.Locale;
* A default {@link ContextMenuItemDelegate} that supports the context menu functionality in Tab.
*/
public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
- public static final String PAGESPEED_PASSTHROUGH_HEADERS =
- "Chrome-Proxy-Accept-Transform: identity\nCache-Control: no-cache";
-
private final Tab mTab;
private boolean mLoadOriginalImageRequestedForPageLoad;
private EmptyTabObserver mDataReductionProxyContextMenuTabObserver;
@@ -215,7 +212,10 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
public void onOpenImageInNewTab(String url, Referrer referrer) {
boolean useOriginal = isSpdyProxyEnabledForUrl(url);
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
- loadUrlParams.setVerbatimHeaders(useOriginal ? PAGESPEED_PASSTHROUGH_HEADERS : null);
+ loadUrlParams.setVerbatimHeaders(useOriginal
+ ? DataReductionProxySettings.getInstance()
+ .getDataReductionProxyPassThroughHeader()
+ : null);
loadUrlParams.setReferrer(referrer);
mTab.getActivity().getTabModelSelector().openNewTab(loadUrlParams,
TabLaunchType.FROM_LONGPRESS_BACKGROUND, mTab, isIncognito());

Powered by Google App Engine
This is Rietveld 408576698