Index: content/shell/android/java/org/chromium/content_shell/ContentShellActivity.java |
diff --git a/content/shell/android/java/org/chromium/content_shell/ContentShellActivity.java b/content/shell/android/java/org/chromium/content_shell/ContentShellActivity.java |
index a3a102820d26f0d65ccaafcdb8810d0ff2a8d45a..ce6ca88c7af30f53b121b2cc376b72f2909990c5 100644 |
--- a/content/shell/android/java/org/chromium/content_shell/ContentShellActivity.java |
+++ b/content/shell/android/java/org/chromium/content_shell/ContentShellActivity.java |
@@ -7,11 +7,14 @@ package org.chromium.content_shell; |
import android.app.Activity; |
import android.content.Intent; |
import android.os.Bundle; |
+import android.os.Debug; |
import android.text.TextUtils; |
import android.util.Log; |
import android.view.KeyEvent; |
+import org.chromium.content.browser.CommandLine; |
import org.chromium.content.browser.ContentView; |
+import org.chromium.content.browser.LibraryLoader; |
/** |
* Activity for managing the Content Shell. |
@@ -20,6 +23,7 @@ public class ContentShellActivity extends Activity { |
private static final String COMMAND_LINE_FILE = "/data/local/content-shell-command-line"; |
private static final String TAG = "ContentShellActivity"; |
+ private static final String NATIVE_LIBRARY = "content_shell_content_view"; |
private ShellManager mShellManager; |
@@ -28,17 +32,17 @@ public class ContentShellActivity extends Activity { |
super.onCreate(savedInstanceState); |
// Initializing the command line must occur before loading the library. |
- // TODO(tedchoc): Initialize command line from file. |
+ CommandLine.initFromFile(COMMAND_LINE_FILE); |
String startupUrl = getUrlFromIntent(getIntent()); |
if (!TextUtils.isEmpty(startupUrl)) { |
- // TODO(tedchoc): Append URL to command line. |
+ CommandLine.getInstance().appendSwitchesAndArguments( |
+ new String[] {ShellView.sanitizeUrl(startupUrl)}); |
} |
- // TODO(jrg,tedchoc): upstream the async library loader, then |
- // make this call look like this: |
- // LibraryLoader.loadAndInitSync(); |
- loadNativeLibrary(); |
- |
+ // TODO(jrg): once command line support is addef (for |
+ // --wait-for-debugger), remove this. |
+ // Debug.waitForDebugger(); |
+ LibraryLoader.loadAndInitSync(); |
initializeContentViewResources(); |
setContentView(R.layout.content_shell_activity); |
@@ -93,18 +97,4 @@ public class ContentShellActivity extends Activity { |
ContentView.registerPopupOverlayCornerRadius(0); |
ContentView.registerPopupOverlayResourceId(R.drawable.popup_zoomer_overlay); |
} |
- |
- |
- private static final String NATIVE_LIBRARY = "content_shell_content_view"; |
- |
- private void loadNativeLibrary() throws UnsatisfiedLinkError { |
- Log.i(TAG, "loading: " + NATIVE_LIBRARY); |
- try { |
- System.loadLibrary(NATIVE_LIBRARY); |
- } catch (UnsatisfiedLinkError e) { |
- Log.e(TAG, "Unable to load lib" + NATIVE_LIBRARY + ".so: " + e); |
- throw e; |
- } |
- Log.i(TAG, "loaded: " + NATIVE_LIBRARY); |
- } |
} |