| OLD | NEW |
| 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.base.library_loader.LibraryProcessType; | 10 import org.chromium.base.library_loader.LibraryProcessType; |
| 11 import org.chromium.chrome.browser.ChromeApplication; | 11 import org.chromium.chrome.browser.ChromeApplication; |
| 12 import org.chromium.chrome.browser.ShortcutHelper; | 12 import org.chromium.chrome.browser.ShortcutHelper; |
| 13 import org.chromium.chrome.browser.banners.AppBannerManager; | 13 import org.chromium.chrome.browser.banners.AppBannerManager; |
| 14 import org.chromium.chrome.browser.externalnav.ExternalNavigationParams; | 14 import org.chromium.chrome.browser.externalnav.ExternalNavigationParams; |
| 15 import org.chromium.chrome.browser.tab.InterceptNavigationDelegateImpl; | 15 import org.chromium.chrome.browser.tab.InterceptNavigationDelegateImpl; |
| 16 import org.chromium.chrome.browser.tab.Tab; | 16 import org.chromium.chrome.browser.tab.Tab; |
| 17 import org.chromium.chrome.browser.tab.TabDelegateFactory; | 17 import org.chromium.chrome.browser.tab.TabDelegateFactory; |
| 18 import org.chromium.chrome.browser.tab.TabRedirectHandler; | 18 import org.chromium.chrome.browser.tab.TabRedirectHandler; |
| 19 import org.chromium.components.navigation_interception.NavigationParams; | 19 import org.chromium.components.navigation_interception.NavigationParams; |
| 20 import org.chromium.content.browser.ChildProcessCreationParams; | 20 import org.chromium.content.browser.ChildProcessCreationParams; |
| 21 import org.chromium.content_public.browser.LoadUrlParams; | 21 import org.chromium.content_public.browser.LoadUrlParams; |
| 22 import org.chromium.ui.base.PageTransition; | 22 import org.chromium.ui.base.PageTransition; |
| 23 import org.chromium.webapk.lib.client.WebApkServiceConnectionManager; | 23 import org.chromium.webapk.lib.client.WebApkServiceConnectionManager; |
| 24 import org.chromium.webapk.lib.common.WebApkSandboxedProcessService; |
| 24 | 25 |
| 25 /** | 26 /** |
| 26 * An Activity is designed for WebAPKs (native Android apps) and displays a weba
pp in a nearly | 27 * An Activity is designed for WebAPKs (native Android apps) and displays a weba
pp in a nearly |
| 27 * UI-less Chrome. | 28 * UI-less Chrome. |
| 28 */ | 29 */ |
| 29 public class WebApkActivity extends WebappActivity { | 30 public class WebApkActivity extends WebappActivity { |
| 30 @Override | 31 @Override |
| 31 protected void onNewIntent(Intent intent) { | 32 protected void onNewIntent(Intent intent) { |
| 32 super.onNewIntent(intent); | 33 super.onNewIntent(intent); |
| 33 // We could bring a WebAPK hosted WebappActivity to foreground and navig
ate it to a | 34 // We could bring a WebAPK hosted WebappActivity to foreground and navig
ate it to a |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 * {@link isForWebApk}} is true; as Chrome's child process otherwise. | 124 * {@link isForWebApk}} is true; as Chrome's child process otherwise. |
| 124 * @param isForWebApk: Whether the {@link ChildProcessCreationParams} is ini
tialized as a | 125 * @param isForWebApk: Whether the {@link ChildProcessCreationParams} is ini
tialized as a |
| 125 * WebAPK renderer process. | 126 * WebAPK renderer process. |
| 126 */ | 127 */ |
| 127 private void initializeChildProcessCreationParams(boolean isForWebApk) { | 128 private void initializeChildProcessCreationParams(boolean isForWebApk) { |
| 128 ChromeApplication chrome = (ChromeApplication) ContextUtils.getApplicati
onContext(); | 129 ChromeApplication chrome = (ChromeApplication) ContextUtils.getApplicati
onContext(); |
| 129 ChildProcessCreationParams params = chrome.getChildProcessCreationParams
(); | 130 ChildProcessCreationParams params = chrome.getChildProcessCreationParams
(); |
| 130 if (isForWebApk) { | 131 if (isForWebApk) { |
| 131 int extraBindFlag = params == null ? 0 : params.getExtraBindFlags(); | 132 int extraBindFlag = params == null ? 0 : params.getExtraBindFlags(); |
| 132 params = new ChildProcessCreationParams(getWebappInfo().webApkPackag
eName(), | 133 params = new ChildProcessCreationParams(getWebappInfo().webApkPackag
eName(), |
| 133 extraBindFlag, LibraryProcessType.PROCESS_CHILD); | 134 extraBindFlag, LibraryProcessType.PROCESS_CHILD, |
| 135 WebApkSandboxedProcessService.class); |
| 134 } | 136 } |
| 135 ChildProcessCreationParams.set(params); | 137 ChildProcessCreationParams.set(params); |
| 136 } | 138 } |
| 137 } | 139 } |
| OLD | NEW |