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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java

Issue 1888773004: 🙅 Bind a WebAPK to its "host" browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add template apk Created 4 years, 8 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/tab/InterceptNavigationDelegateImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
index ecdc48637f4eaf8a1ba4c3a3710ab655f1c01371..c6dffe1fdad3c746389d00b48735568e18398a99 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
@@ -4,9 +4,7 @@
package org.chromium.chrome.browser.tab;
-import android.content.Context;
import android.content.Intent;
-import android.content.SharedPreferences;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
@@ -23,7 +21,6 @@ import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.common.ConsoleMessageLevel;
import org.chromium.minting.lib.client.NavigationClient;
import org.chromium.minting.lib.client.WebAPKValidator;
-import org.chromium.minting.lib.common.WebAPKConstants;
/**
* Class that controls navigations and allows to intercept them. It is used on Android to 'convert'
@@ -33,14 +30,12 @@ import org.chromium.minting.lib.common.WebAPKConstants;
public class InterceptNavigationDelegateImpl implements InterceptNavigationDelegate {
private static final String CHROME_LAUNCH_ACTIVITY =
"org.chromium.chrome.browser.document.ChromeLauncherActivity";
- private static final String DEFAULT_CHROME_PACKAGE_NAME = "com.google.android.apps.chrome";
private final Tab mTab;
private final ExternalNavigationHandler mExternalNavHandler;
private final AuthenticatorNavigationInterceptor mAuthenticatorHelper;
private ExternalNavigationHandler.OverrideUrlLoadingResult mLastOverrideUrlLoadingResult =
ExternalNavigationHandler.OverrideUrlLoadingResult.NO_OVERRIDE;
- private String mChromePackageFromPref = null;
/**
* Whether forward history should be cleared after navigation is committed.
@@ -252,15 +247,9 @@ public class InterceptNavigationDelegateImpl implements InterceptNavigationDeleg
}
private void onOverrideUrlLoadingBackToChrome(String url) {
Xi Han 2016/04/15 14:46:49 Rename this function to "onOverrideUrlLoadingBackT
Yaron 2016/04/15 15:46:58 Done.
- if (mChromePackageFromPref == null) {
- SharedPreferences prefs = mTab.getActivity().getSharedPreferences(
- WebAPKConstants.MINT_PREFS, Context.MODE_PRIVATE);
- mChromePackageFromPref = prefs.getString(WebAPKConstants.HOST_PACKAGE_PREF,
- DEFAULT_CHROME_PACKAGE_NAME);
- }
mTab.getActivity().startActivity(
NavigationClient.createIntentToNavigateBackToHost(
- mChromePackageFromPref, url, CHROME_LAUNCH_ACTIVITY));
+ mTab.getApplicationContext(), url, CHROME_LAUNCH_ACTIVITY));
}
private void logBlockedNavigationToDevToolsConsole(String url) {

Powered by Google App Engine
This is Rietveld 408576698