Commit 28a00823 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Android: In-place URL loading for Preview Tab

Clicking on a link that would open a new tab should just navigate to
that website when the link is clicked in a preview tab.

The request for urls to be opened in a new tab goes through
WebContentsDelegate |shouldCreateWebContents| -> |webContentsCreated|
-> |addNewContents|. This CL handles it by having
|shouldCreateWebContents| return false so that no new WebContents
object is created. The passed URL is loaded into the preview
tab instead.

Bug: 1014777
Change-Id: If4fd76f563427aaae230af4e0519c2c388791fa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954990Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722682}
parent 2f89fe5e
...@@ -219,6 +219,12 @@ public class OverlayPanelContent { ...@@ -219,6 +219,12 @@ public class OverlayPanelContent {
mContentDelegate.onOpenNewTabRequested(url); mContentDelegate.onOpenNewTabRequested(url);
} }
@Override
public boolean shouldCreateWebContents(String targetUrl) {
mContentDelegate.onOpenNewTabRequested(targetUrl);
return false;
}
@Override @Override
public int getTopControlsHeight() { public int getTopControlsHeight() {
return (int) (mBarHeightPx return (int) (mBarHeightPx
......
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