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

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

Issue 2035183002: Upstream: Launch WebAPK without showing intent picker when user taps link in WebAPK scope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.content.Intent; 7 import android.content.Intent;
8 8
9 import org.chromium.base.ContextUtils; 9 import org.chromium.base.ContextUtils;
10 import org.chromium.chrome.browser.ShortcutHelper; 10 import org.chromium.chrome.browser.ShortcutHelper;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 @Override 55 @Override
56 public InterceptNavigationDelegateImpl createInterceptNavigationDele gate(Tab tab) { 56 public InterceptNavigationDelegateImpl createInterceptNavigationDele gate(Tab tab) {
57 return new InterceptNavigationDelegateImpl(tab) { 57 return new InterceptNavigationDelegateImpl(tab) {
58 @Override 58 @Override
59 public ExternalNavigationParams.Builder buildExternalNavigat ionParams( 59 public ExternalNavigationParams.Builder buildExternalNavigat ionParams(
60 NavigationParams navigationParams, 60 NavigationParams navigationParams,
61 TabRedirectHandler tabRedirectHandler, boolean shoul dCloseTab) { 61 TabRedirectHandler tabRedirectHandler, boolean shoul dCloseTab) {
62 ExternalNavigationParams.Builder builder = 62 ExternalNavigationParams.Builder builder =
63 super.buildExternalNavigationParams( 63 super.buildExternalNavigationParams(
64 navigationParams, tabRedirectHandler, sh ouldCloseTab); 64 navigationParams, tabRedirectHandler, sh ouldCloseTab);
65 builder.setIsWebApk(true); 65 builder.setWebApkPackageName(getWebApkPackageName());
66 return builder; 66 return builder;
67 } 67 }
68 }; 68 };
69 } 69 }
70 70
71 @Override 71 @Override
72 public AppBannerManager createAppBannerManager(Tab tab) { 72 public AppBannerManager createAppBannerManager(Tab tab) {
73 // Do not show app banners for WebAPKs regardless of the current page URL. 73 // Do not show app banners for WebAPKs regardless of the current page URL.
74 // A WebAPK can display a page outside of its WebAPK scope if a page within the 74 // A WebAPK can display a page outside of its WebAPK scope if a page within the
75 // WebAPK scope navigates via JavaScript while the WebAPK is in the background. 75 // WebAPK scope navigates via JavaScript while the WebAPK is in the background.
76 return null; 76 return null;
77 } 77 }
78 }; 78 };
79 } 79 }
80 80
81 public void onStop() { 81 public void onStop() {
82 super.onStop(); 82 super.onStop();
83 String packageName = getWebappInfo().webApkPackageName();
84 WebApkServiceConnectionManager.getInstance().disconnect( 83 WebApkServiceConnectionManager.getInstance().disconnect(
85 ContextUtils.getApplicationContext(), packageName); 84 ContextUtils.getApplicationContext(), getWebApkPackageName());
85 }
86
87 /**
88 * Returns the WebAPK's package name.
89 */
90 private String getWebApkPackageName() {
91 return getWebappInfo().webApkPackageName();
86 } 92 }
87 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698