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

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

Issue 2419483002: Revert of Fix tab redirect to apps in Herb mode. (Closed)
Patch Set: Created 4 years, 2 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/document/ChromeLauncherActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
index e419eb4fcaa12bd496f1312e9cd65eaf7bbfff0a..799ba6adf2cec0c199dddc718c3fecc40c0002f7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java
@@ -87,6 +87,11 @@
*/
private static final int PARTNER_BROWSER_CUSTOMIZATIONS_TIMEOUT_MS = 10000;
+ /**
+ * Maximum delay for initial document activity launch.
+ */
+ private static final int INITIAL_DOCUMENT_ACTIVITY_LAUNCH_TIMEOUT_MS = 500;
+
private static final LaunchMetrics.SparseHistogramSample sIntentFlagsHistogram =
new LaunchMetrics.SparseHistogramSample("Launch.IntentFlags");
@@ -351,7 +356,7 @@
/**
* Adds extras to the Intent that are needed by Herb.
*/
- public static void updateHerbIntent(Context context, Intent newIntent) {
+ public static void updateHerbIntent(Context context, Intent newIntent, Uri uri) {
// For Elderberry flavored Herbs that are to be launched in a separate task, add a random
// UUID to try and prevent Android from refocusing/clobbering items that share the same
// base intent. If we do support refocusing of existing Herbs, we need to do it on the
@@ -384,6 +389,10 @@
}
newIntent.putExtra(CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM, true);
+ newIntent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME, true);
+
+ // Mark this as a trusted Chrome Intent.
+ IntentHandler.addTrustedIntentExtras(newIntent, context);
}
/**
@@ -419,19 +428,7 @@
newIntent.setFlags(
newIntent.getFlags() & ~Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
}
-
- if (addHerbExtras) {
- // TODO(tedchoc|mariakhomenko): Specifically not marking the intent is from Chrome via
- // IntentHandler.addTrustedIntentExtras as it breaks the
- // redirect logic for triggering instant apps. See if
- // this is better addressed in TabRedirectHandler long
- // term.
- newIntent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME, true);
- } else {
- IntentUtils.safeRemoveExtra(
- intent, CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME);
- }
- if (addHerbExtras) updateHerbIntent(context, newIntent);
+ if (addHerbExtras) updateHerbIntent(context, newIntent, uri);
return newIntent;
}

Powered by Google App Engine
This is Rietveld 408576698