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

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

Issue 2049843004: Upstream: Renderers are running in WebAPKs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Maria's comments. 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.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
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);
no sievers 2016/06/23 17:18:50 Would it also be possible to override through the
Xi Han 2016/06/23 17:34:56 Do you ask is it possible that we may change the s
no sievers 2016/06/23 17:45:33 And also because maybe it's a nicer place than set
Xi Han 2016/06/23 18:00:26 Sounds like maybe we need to introduce something l
134 } 136 }
135 ChildProcessCreationParams.set(params); 137 ChildProcessCreationParams.set(params);
136 } 138 }
137 } 139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698