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

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

Issue 47343002: Pass app URL to mojo_shell on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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 | « mojo/mojo.gyp ('k') | mojo/shell/android/shell_apk/src/org/chromium/mojo_shell_apk/MojoMain.java » ('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 56d2696fc72c382f38570e6ec218d32183ae75b5..dacd072935897f45280e847e0026da89faef8818 100644
--- a/mojo/shell/android/mojo_main.cc
+++ b/mojo/shell/android/mojo_main.cc
@@ -4,6 +4,7 @@
#include "mojo/shell/android/mojo_main.h"
+#include "base/android/jni_string.h"
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -47,7 +48,7 @@ void StartOnShellThread() {
} // namspace
-static void Start(JNIEnv* env, jclass clazz, jobject context) {
+static void Start(JNIEnv* env, jclass clazz, jobject context, jstring jurl) {
base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context);
base::android::InitApplicationContext(scoped_context);
@@ -58,6 +59,14 @@ static void Start(JNIEnv* env, jclass clazz, jobject context) {
CommandLine::Init(0, 0);
InitializeLogging();
+ if (jurl) {
+ std::string app_url = base::android::ConvertJavaStringToUTF8(env, jurl);
+ std::vector<std::string> argv;
+ argv.push_back("mojo_shell");
+ argv.push_back("--app=" + app_url);
+ CommandLine::ForCurrentProcess()->InitFromArgv(argv);
+ }
+
g_main_thread.Get().reset(new base::Thread("shell_thread"));
g_main_thread.Get()->Start();
g_main_thread.Get()->message_loop()->PostTask(FROM_HERE,
« no previous file with comments | « mojo/mojo.gyp ('k') | mojo/shell/android/shell_apk/src/org/chromium/mojo_shell_apk/MojoMain.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698