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 "mojo/runner/android/main.h" | 5 #include "mojo/runner/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 Java_ShellMain_finishActivity(base::android::AttachCurrentThread(), | 92 Java_ShellMain_finishActivity(base::android::AttachCurrentThread(), |
93 g_main_activiy.Get().obj()); | 93 g_main_activiy.Get().obj()); |
94 exit(0); | 94 exit(0); |
95 } | 95 } |
96 | 96 |
97 void MojoShellRunner::Run() { | 97 void MojoShellRunner::Run() { |
98 base::MessageLoop loop(common::MessagePumpMojo::Create()); | 98 base::MessageLoop loop(common::MessagePumpMojo::Create()); |
99 Context* context = g_context.Pointer()->get(); | 99 Context* context = g_context.Pointer()->get(); |
100 ConfigureAndroidServices(context); | 100 ConfigureAndroidServices(context); |
101 context->Init(); | 101 context->Init(); |
102 | 102 context->RunCommandLineApplication(); |
103 context->Run(GURL("mojo:window_manager")); | |
104 loop.Run(); | 103 loop.Run(); |
105 | 104 |
106 g_java_message_loop.Pointer()->get()->PostTask(FROM_HERE, | 105 g_java_message_loop.Pointer()->get()->PostTask(FROM_HERE, |
107 base::Bind(&QuitShellThread)); | 106 base::Bind(&QuitShellThread)); |
108 } | 107 } |
109 | 108 |
110 // Initialize stdout redirection if the command line switch is present. | 109 // Initialize stdout redirection if the command line switch is present. |
111 void InitializeRedirection() { | 110 void InitializeRedirection() { |
112 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(kFifoPath)) | 111 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(kFifoPath)) |
113 return; | 112 return; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 } | 204 } |
206 | 205 |
207 } // namespace runner | 206 } // namespace runner |
208 } // namespace mojo | 207 } // namespace mojo |
209 | 208 |
210 // TODO(vtl): Even though main() should never be called, mojo_shell fails to | 209 // TODO(vtl): Even though main() should never be called, mojo_shell fails to |
211 // link without it. Figure out if we can avoid this. | 210 // link without it. Figure out if we can avoid this. |
212 int main(int argc, char** argv) { | 211 int main(int argc, char** argv) { |
213 NOTREACHED(); | 212 NOTREACHED(); |
214 } | 213 } |
OLD | NEW |