| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "shell/android/mojo_main.h" | 5 #include "shell/android/mojo_main.h" |
| 6 | 6 |
| 7 #include "base/android/fifo_utils.h" | 7 #include "base/android/fifo_utils.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Android handler is bundled with the Mojo shell, because it uses the | 78 // Android handler is bundled with the Mojo shell, because it uses the |
| 79 // MojoShell application as the JNI bridge to bootstrap execution of other | 79 // MojoShell application as the JNI bridge to bootstrap execution of other |
| 80 // Android Mojo apps that need JNI. | 80 // Android Mojo apps that need JNI. |
| 81 context->application_manager()->SetLoaderForURL( | 81 context->application_manager()->SetLoaderForURL( |
| 82 make_scoped_ptr(new BackgroundApplicationLoader( | 82 make_scoped_ptr(new BackgroundApplicationLoader( |
| 83 make_scoped_ptr(new AndroidHandlerLoader()), "android_handler", | 83 make_scoped_ptr(new AndroidHandlerLoader()), "android_handler", |
| 84 base::MessageLoop::TYPE_DEFAULT)), | 84 base::MessageLoop::TYPE_DEFAULT)), |
| 85 GURL("mojo:android_handler")); | 85 GURL("mojo:android_handler")); |
| 86 | 86 |
| 87 // By default, the keyboard is handled by the native_viewport_service. | 87 // By default, the keyboard is handled by the native_viewport_service. |
| 88 context->mojo_url_resolver()->AddCustomMapping( | 88 context->url_resolver()->AddURLMapping( |
| 89 GURL("mojo:keyboard"), GURL("mojo:native_viewport_service")); | 89 GURL("mojo:keyboard"), GURL("mojo:native_viewport_service")); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void QuitShellThread() { | 92 void QuitShellThread() { |
| 93 g_shell_thread.Get()->Join(); | 93 g_shell_thread.Get()->Join(); |
| 94 g_shell_thread.Pointer()->reset(); | 94 g_shell_thread.Pointer()->reset(); |
| 95 Java_MojoMain_finishActivity(base::android::AttachCurrentThread(), | 95 Java_MojoMain_finishActivity(base::android::AttachCurrentThread(), |
| 96 g_main_activiy.Get().obj()); | 96 g_main_activiy.Get().obj()); |
| 97 exit(0); | 97 exit(0); |
| 98 } | 98 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 base::CommandLine::ForCurrentProcess()->AppendArg( | 194 base::CommandLine::ForCurrentProcess()->AppendArg( |
| 195 base::android::ConvertJavaStringToUTF8(env, jurl)); | 195 base::android::ConvertJavaStringToUTF8(env, jurl)); |
| 196 } | 196 } |
| 197 | 197 |
| 198 bool RegisterMojoMain(JNIEnv* env) { | 198 bool RegisterMojoMain(JNIEnv* env) { |
| 199 return RegisterNativesImpl(env); | 199 return RegisterNativesImpl(env); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace shell | 202 } // namespace shell |
| 203 } // namespace mojo | 203 } // namespace mojo |
| OLD | NEW |