| 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/main.h" | 5 #include "shell/android/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 15 matching lines...) Expand all Loading... |
| 26 #include "shell/android/native_viewport_application_loader.h" | 26 #include "shell/android/native_viewport_application_loader.h" |
| 27 #include "shell/android/ui_application_loader_android.h" | 27 #include "shell/android/ui_application_loader_android.h" |
| 28 #include "shell/application_manager/application_loader.h" | 28 #include "shell/application_manager/application_loader.h" |
| 29 #include "shell/command_line_util.h" | 29 #include "shell/command_line_util.h" |
| 30 #include "shell/context.h" | 30 #include "shell/context.h" |
| 31 #include "shell/init.h" | 31 #include "shell/init.h" |
| 32 #include "ui/gl/gl_surface_egl.h" | 32 #include "ui/gl/gl_surface_egl.h" |
| 33 | 33 |
| 34 using base::LazyInstance; | 34 using base::LazyInstance; |
| 35 | 35 |
| 36 namespace mojo { | |
| 37 namespace shell { | 36 namespace shell { |
| 38 | 37 |
| 39 namespace { | 38 namespace { |
| 40 | 39 |
| 41 // Tag for logging. | 40 // Tag for logging. |
| 42 const char kLogTag[] = "chromium"; | 41 const char kLogTag[] = "chromium"; |
| 43 | 42 |
| 44 // Command line argument for the communication fifo. | 43 // Command line argument for the communication fifo. |
| 45 const char kFifoPath[] = "fifo-path"; | 44 const char kFifoPath[] = "fifo-path"; |
| 46 | 45 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 100 |
| 102 void QuitShellThread() { | 101 void QuitShellThread() { |
| 103 g_shell_thread.Get()->Join(); | 102 g_shell_thread.Get()->Join(); |
| 104 g_shell_thread.Pointer()->reset(); | 103 g_shell_thread.Pointer()->reset(); |
| 105 Java_ShellMain_finishActivity(base::android::AttachCurrentThread(), | 104 Java_ShellMain_finishActivity(base::android::AttachCurrentThread(), |
| 106 g_main_activiy.Get().obj()); | 105 g_main_activiy.Get().obj()); |
| 107 exit(0); | 106 exit(0); |
| 108 } | 107 } |
| 109 | 108 |
| 110 void MojoShellRunner::Run() { | 109 void MojoShellRunner::Run() { |
| 111 base::MessageLoop loop(common::MessagePumpMojo::Create()); | 110 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); |
| 112 Context* context = g_context.Pointer()->get(); | 111 Context* context = g_context.Pointer()->get(); |
| 113 ConfigureAndroidServices(context); | 112 ConfigureAndroidServices(context); |
| 114 context->InitWithPaths(mojo_shell_path_, mojo_shell_child_path_); | 113 context->InitWithPaths(mojo_shell_path_, mojo_shell_child_path_); |
| 115 | 114 |
| 116 for (const auto& args : parameters_) | 115 for (const auto& args : parameters_) |
| 117 ApplyApplicationArgs(context, args); | 116 ApplyApplicationArgs(context, args); |
| 118 | 117 |
| 119 RunCommandLineApps(context); | 118 RunCommandLineApps(context); |
| 120 loop.Run(); | 119 loop.Run(); |
| 121 | 120 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 static void AddApplicationURL(JNIEnv* env, jclass clazz, jstring jurl) { | 217 static void AddApplicationURL(JNIEnv* env, jclass clazz, jstring jurl) { |
| 219 base::CommandLine::ForCurrentProcess()->AppendArg( | 218 base::CommandLine::ForCurrentProcess()->AppendArg( |
| 220 base::android::ConvertJavaStringToUTF8(env, jurl)); | 219 base::android::ConvertJavaStringToUTF8(env, jurl)); |
| 221 } | 220 } |
| 222 | 221 |
| 223 bool RegisterShellMain(JNIEnv* env) { | 222 bool RegisterShellMain(JNIEnv* env) { |
| 224 return RegisterNativesImpl(env); | 223 return RegisterNativesImpl(env); |
| 225 } | 224 } |
| 226 | 225 |
| 227 } // namespace shell | 226 } // namespace shell |
| 228 } // namespace mojo | |
| 229 | 227 |
| 230 // TODO(vtl): We need a main(), even though it should never be called. | 228 // TODO(vtl): We need a main(), even though it should never be called. |
| 231 int main(int argc, char** argv) { | 229 int main(int argc, char** argv) { |
| 232 NOTREACHED(); | 230 NOTREACHED(); |
| 233 return 1; | 231 return 1; |
| 234 } | 232 } |
| OLD | NEW |