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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java

Issue 2005053002: WebAPKs: Open links which are outside of WebAPK scope in Chrome not in WebAPK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/webapps/WebApkActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
index 3bdd159a09a45342ff5780c65cb21e66e04dc1fd..1872e6de5dd76cfd1b2fc70a026d5cf4ed1e2478 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
@@ -9,8 +9,12 @@ import android.content.Intent;
import org.chromium.base.ContextUtils;
import org.chromium.chrome.browser.ShortcutHelper;
import org.chromium.chrome.browser.banners.AppBannerManager;
+import org.chromium.chrome.browser.externalnav.ExternalNavigationParams;
+import org.chromium.chrome.browser.tab.InterceptNavigationDelegateImpl;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabDelegateFactory;
+import org.chromium.chrome.browser.tab.TabRedirectHandler;
+import org.chromium.components.navigation_interception.NavigationParams;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.PageTransition;
import org.chromium.webapk.lib.client.WebApkServiceConnectionManager;
@@ -49,6 +53,22 @@ public class WebApkActivity extends WebappActivity {
protected TabDelegateFactory createTabDelegateFactory() {
return new WebappDelegateFactory(this) {
@Override
+ public InterceptNavigationDelegateImpl createInterceptNavigationDelegate(Tab tab) {
+ return new InterceptNavigationDelegateImpl(tab) {
+ @Override
+ public ExternalNavigationParams.Builder buildExternalNavigationParams(
+ NavigationParams navigationParams,
+ TabRedirectHandler tabRedirectHandler, boolean shouldCloseTab) {
+ ExternalNavigationParams.Builder builder =
+ super.buildExternalNavigationParams(
+ navigationParams, tabRedirectHandler, shouldCloseTab);
+ builder.setIsWebApk(true);
+ return builder;
+ }
+ };
+ }
+
+ @Override
public AppBannerManager createAppBannerManager(Tab tab) {
// Do not show app banners for WebAPKs regardless of the current page URL.
// A WebAPK can display a page outside of its WebAPK scope if a page within the

Powered by Google App Engine
This is Rietveld 408576698