import org.chromium.base.MemoryPressureListener;
import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.ProcessInitException;
+import org.chromium.content.app.ContentApplication;
import org.chromium.content.browser.BrowserStartupController;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.DeviceUtils;
import org.chromium.content.common.ContentSwitches;
+import org.chromium.content_public.browser.WebContents;
import org.chromium.content_shell.Shell;
import org.chromium.content_shell.ShellManager;
import org.chromium.ui.base.ActivityWindowAndroid;
*/
public class ContentShellActivity extends Activity {
- public static final String COMMAND_LINE_FILE = "/data/local/tmp/content-shell-command-line";
private static final String TAG = "ContentShellActivity";
private static final String ACTIVE_SHELL_URL_KEY = "activeUrl";
// Initializing the command line must occur before loading the library.
if (!CommandLine.isInitialized()) {
- CommandLine.initFromFile(COMMAND_LINE_FILE);
+ ContentApplication.initCommandLine(this);
String[] commandLineParams = getCommandLineParamsFromIntent(getIntent());
if (commandLineParams != null) {
CommandLine.getInstance().appendSwitchesAndArguments(commandLineParams);
Shell shell = getActiveShell();
return shell != null ? shell.getContentViewCore() : null;
}
+
+ /**
+ * @return The {@link WebContents} owned by the currently visible {@link Shell} or null if
+ * one is not showing.
+ */
+ public WebContents getActiveWebContents() {
+ Shell shell = getActiveShell();
+ return shell != null ? shell.getWebContents() : null;
+ }
+
}