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

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

Issue 782013002: Android: decouple mojo shell from the network service. (Closed) Base URL: https://github.com/domokit/mojo.git@build-rule-for-the-network-service
Patch Set: Created 6 years 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
Index: mojo/shell/android/mojo_main.cc
diff --git a/mojo/shell/android/mojo_main.cc b/mojo/shell/android/mojo_main.cc
index a8afd89f6c19725d4671b79c7b20fd4f1464a877..0c7f84c275a116b963277ed29247fe3889014175 100644
--- a/mojo/shell/android/mojo_main.cc
+++ b/mojo/shell/android/mojo_main.cc
@@ -6,6 +6,7 @@
#include "base/android/command_line_android.h"
#include "base/android/java_handler_thread.h"
+#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/at_exit.h"
#include "base/bind.h"
@@ -51,9 +52,9 @@ void RunShell(std::vector<GURL> app_urls) {
static void Init(JNIEnv* env,
jclass clazz,
jobject context,
- jobjectArray jparameters) {
+ jobjectArray jparameters,
+ jstring j_local_apps_directory) {
base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context);
-
base::android::InitApplicationContext(env, scoped_context);
base::android::InitNativeCommandLineFromJavaArray(env, jparameters);
@@ -63,7 +64,10 @@ static void Init(JNIEnv* env,
// LazyInstances is akin to stack-allocating objects; their destructors
// will be invoked first-in-last-out.
shell::Context* shell_context = new shell::Context();
+ shell_context->mojo_url_resolver()->SetLocalAppsPath(base::FilePath(
+ base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory)));
g_context.Get().reset(shell_context);
+
g_java_message_loop.Get().reset(new base::MessageLoopForUI);
base::MessageLoopForUI::current()->Start();

Powered by Google App Engine
This is Rietveld 408576698