Commit 7caff810 authored by Troy Hildebrandt's avatar Troy Hildebrandt Committed by Commit Bot

[Android] Avoid overriding with intent when lazy loading a frozen tab.

Opening a link in a new tab on low end devices freezes the tab to be
lazily loaded when the tab is used for the first time. Opening links
with intents from a frozen state causes us to override the URL handling
with the external intent which results in an app being launched on
selecting that tab, or the picker being shown, instead of seeing the
contents at the URL displayed in the tab.

This patch treats the page transition type sent to #loadUrl as RELOAD
whenever we're loading a URL for the first time in a frozen tab which
avoids starting another activity.

Bug: 758027
Change-Id: I89e63fb51b00d1c62b12c8f6d827e3e907e463b1
Reviewed-on: https://chromium-review.googlesource.com/956558Reviewed-by: default avatarMaria Khomenko <mariakhomenko@chromium.org>
Commit-Queue: Troy Hildebrandt <thildebr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542250}
parent 54f7c6bd
......@@ -322,10 +322,16 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
break;
case FROM_CHROME_UI:
case FROM_LONGPRESS_FOREGROUND:
case FROM_LONGPRESS_BACKGROUND:
case FROM_LAUNCHER_SHORTCUT:
transition = PageTransition.AUTO_TOPLEVEL;
break;
case FROM_LONGPRESS_BACKGROUND:
// On low end devices tabs are backgrounded in a frozen state, so we set the
// transition type to RELOAD to avoid handling intents when the tab is foregrounded.
// (https://crbug.com/758027)
transition = SysUtils.isLowEndDevice() ? PageTransition.RELOAD
: PageTransition.AUTO_TOPLEVEL;
break;
default:
assert false;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment