| Index: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
|
| diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
|
| index 9e37370edd02c25b59d3d1bcc49abc211b91f9e2..cd858c26d125dd80252f85d2671e71149f70110b 100644
|
| --- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
|
| +++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
|
| @@ -23,6 +23,7 @@ import org.chromium.content.browser.ContentVideoViewClient;
|
| import org.chromium.content.browser.ContentView;
|
| import org.chromium.content.browser.ContentViewClient;
|
| import org.chromium.content.browser.DeviceUtils;
|
| +import org.chromium.content.browser.StartupObserver;
|
| import org.chromium.content.browser.TracingIntentHandler;
|
| import org.chromium.content.common.CommandLine;
|
| import org.chromium.content.common.ProcessInitException;
|
| @@ -92,26 +93,37 @@ public class ContentShellActivity extends ChromiumActivity {
|
| if (!TextUtils.isEmpty(startupUrl)) {
|
| mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
|
| }
|
| - if (!AndroidBrowserProcess.init(this, AndroidBrowserProcess.MAX_RENDERERS_LIMIT)) {
|
| +
|
| + if (!AndroidBrowserProcess.init(
|
| + this, AndroidBrowserProcess.MAX_RENDERERS_LIMIT, false, new StartupObserver() {
|
| + @Override
|
| + public void allTasksRun() {
|
| + finishInitialization();
|
| + }
|
| + })) {
|
| String shellUrl = ShellManager.DEFAULT_SHELL_URL;
|
| if (savedInstanceState != null
|
| && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) {
|
| shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
|
| }
|
| mShellManager.launchShell(shellUrl);
|
| + finishInitialization();
|
| }
|
| - getActiveContentView().setContentViewClient(new ContentViewClient() {
|
| - @Override
|
| - public ContentVideoViewClient getContentVideoViewClient() {
|
| - return new ActivityContentVideoViewClient(ContentShellActivity.this);
|
| - }
|
| - });
|
| } catch (ProcessInitException e) {
|
| Log.e(TAG, "ContentView initialization failed.", e);
|
| finish();
|
| }
|
| }
|
|
|
| + private void finishInitialization() {
|
| + getActiveContentView().setContentViewClient(new ContentViewClient() {
|
| + @Override
|
| + public ContentVideoViewClient getContentVideoViewClient() {
|
| + return new ActivityContentVideoViewClient(ContentShellActivity.this);
|
| + }
|
| + });
|
| + }
|
| +
|
| @Override
|
| protected void onSaveInstanceState(Bundle outState) {
|
| super.onSaveInstanceState(outState);
|
|
|