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..11f66ba07bcb903681d77fe9820a829f1a430c7b 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 |
@@ -18,6 +18,7 @@ import org.chromium.base.MemoryPressureListener; |
import org.chromium.content.app.LibraryLoader; |
import org.chromium.content.browser.ActivityContentVideoViewClient; |
import org.chromium.content.browser.AndroidBrowserProcess; |
+import org.chromium.content.browser.BrowserStartupConfiguration; |
import org.chromium.content.browser.ContentVideoView; |
import org.chromium.content.browser.ContentVideoViewClient; |
import org.chromium.content.browser.ContentView; |
@@ -92,6 +93,22 @@ public class ContentShellActivity extends ChromiumActivity { |
if (!TextUtils.isEmpty(startupUrl)) { |
mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl)); |
} |
+ |
+ BrowserStartupConfiguration.set(true, |
+ new BrowserStartupConfiguration.StartupCallback() { |
+ |
+ @Override |
+ public void run(int startupResult) { |
+ if(startupResult > 0) { |
+ // TODO: Show error message. |
+ Log.e(TAG, "ContentView initialization failed."); |
+ finish(); |
+ } else { |
+ finishInitialization(); |
+ } |
+ } |
+ }); |
+ |
if (!AndroidBrowserProcess.init(this, AndroidBrowserProcess.MAX_RENDERERS_LIMIT)) { |
String shellUrl = ShellManager.DEFAULT_SHELL_URL; |
Yaron
2013/07/30 00:06:24
Shouldn't this also be part of finishInitializatio
aberent
2013/07/30 15:01:54
I am not sure why it is different, but it is repro
Yaron
2013/07/30 18:53:22
I think that in practice, this always starts the b
|
if (savedInstanceState != null |
@@ -99,19 +116,23 @@ public class ContentShellActivity extends ChromiumActivity { |
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); |