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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 GURL("mojo:native_viewport_service")); | 76 GURL("mojo:native_viewport_service")); |
77 | 77 |
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 |
| 87 // By default, the keyboard is handled by the native_viewport_service. |
| 88 context->mojo_url_resolver()->AddCustomMapping( |
| 89 GURL("mojo:keyboard"), GURL("mojo:native_viewport_service")); |
86 } | 90 } |
87 | 91 |
88 void QuitShellThread() { | 92 void QuitShellThread() { |
89 g_shell_thread.Get()->Join(); | 93 g_shell_thread.Get()->Join(); |
90 g_shell_thread.Pointer()->reset(); | 94 g_shell_thread.Pointer()->reset(); |
91 Java_MojoMain_finishActivity(base::android::AttachCurrentThread(), | 95 Java_MojoMain_finishActivity(base::android::AttachCurrentThread(), |
92 g_main_activiy.Get().obj()); | 96 g_main_activiy.Get().obj()); |
93 exit(0); | 97 exit(0); |
94 } | 98 } |
95 | 99 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 base::CommandLine::ForCurrentProcess()->AppendArg( | 194 base::CommandLine::ForCurrentProcess()->AppendArg( |
191 base::android::ConvertJavaStringToUTF8(env, jurl)); | 195 base::android::ConvertJavaStringToUTF8(env, jurl)); |
192 } | 196 } |
193 | 197 |
194 bool RegisterMojoMain(JNIEnv* env) { | 198 bool RegisterMojoMain(JNIEnv* env) { |
195 return RegisterNativesImpl(env); | 199 return RegisterNativesImpl(env); |
196 } | 200 } |
197 | 201 |
198 } // namespace shell | 202 } // namespace shell |
199 } // namespace mojo | 203 } // namespace mojo |
OLD | NEW |