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

Unified Diff: mojo/shell/android/mojo_main.cc

Issue 305013015: Mojo: (Mostly) factor out command-line switches from the shell's load code path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/shell/context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/android/mojo_main.cc
diff --git a/mojo/shell/android/mojo_main.cc b/mojo/shell/android/mojo_main.cc
index 47f7f528552e6170529e97c58194ef1e46dad3f8..3faf73f2207d356f6872399694064da1706d2531 100644
--- a/mojo/shell/android/mojo_main.cc
+++ b/mojo/shell/android/mojo_main.cc
@@ -58,21 +58,15 @@ static void Init(JNIEnv* env, jclass clazz, jobject context) {
}
static void Start(JNIEnv* env, jclass clazz, jobject context, jstring jurl) {
- std::string app_url;
+ std::vector<GURL> app_urls;
#if defined(MOJO_SHELL_DEBUG_URL)
- app_url = MOJO_SHELL_DEBUG_URL;
+ app_urls.push_back(GURL(MOJO_SHELL_DEBUG_URL));
// Sleep for 5 seconds to give the debugger a chance to attach.
sleep(5);
#else
if (jurl)
- app_url = base::android::ConvertJavaStringToUTF8(env, jurl);
+ app_urls.push_back(GURL(base::android::ConvertJavaStringToUTF8(env, jurl)));
#endif
- if (!app_url.empty()) {
- std::vector<std::string> argv;
- argv.push_back("mojo_shell");
- argv.push_back(app_url);
- base::CommandLine::ForCurrentProcess()->InitFromArgv(argv);
- }
g_env.Get().reset(new Environment);
@@ -83,7 +77,7 @@ static void Start(JNIEnv* env, jclass clazz, jobject context, jstring jurl) {
shell_context->set_activity(activity.obj());
g_context.Get().reset(shell_context);
- shell::Run(shell_context);
+ shell::Run(shell_context, app_urls);
}
bool RegisterMojoMain(JNIEnv* env) {
« no previous file with comments | « no previous file | mojo/shell/context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698