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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java

Issue 2245733004: Serve offline page for online URL on disconnected or bad networks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix junit test Created 4 years, 4 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/tabmodel/document/TabDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
index 6a0b6b2cd41d89f4742eaf789940101d3dbf3a17..70c93f15297a72d7f913e812e89dcb9ebd5c6129 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
@@ -8,6 +8,8 @@ import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
+import android.os.Bundle;
+import android.provider.Browser;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ContextUtils;
@@ -25,6 +27,8 @@ import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.PageTransition;
+import java.util.Map;
+
/**
* Asynchronously creates Tabs by creating/starting up Activities.
*/
@@ -131,6 +135,15 @@ public class TabDelegate extends TabCreator {
intent.setComponent(componentName);
}
+ Map<String, String> extraHeaders = asyncParams.getLoadUrlParams().getExtraHeaders();
+ if (!extraHeaders.isEmpty()) {
+ Bundle bundle = new Bundle();
+ for (Map.Entry<String, String> header : extraHeaders.entrySet()) {
+ bundle.putString(header.getKey(), header.getValue());
+ }
+ intent.putExtra(Browser.EXTRA_HEADERS, bundle);
+ }
+
intent.putExtra(IntentHandler.EXTRA_TAB_ID, assignedTabId);
intent.putExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, mIsIncognito);
intent.putExtra(IntentHandler.EXTRA_PARENT_TAB_ID, parentId);

Powered by Google App Engine
This is Rietveld 408576698