| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <iostream> | 6 #include <iostream> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/base_switches.h" |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 12 #include "shell/child_process.h" | 13 #include "shell/child_process.h" |
| 13 #include "shell/command_line_util.h" | 14 #include "shell/command_line_util.h" |
| 14 #include "shell/context.h" | 15 #include "shell/context.h" |
| 15 #include "shell/init.h" | 16 #include "shell/init.h" |
| 16 #include "shell/switches.h" | 17 #include "shell/switches.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 #if defined(OS_LINUX) | 21 #if defined(OS_LINUX) |
| 21 // Copied from ui/gfx/switches.cc to avoid a dependency on //ui/gfx | 22 // Copied from ui/gfx/switches.cc to avoid a dependency on //ui/gfx |
| 22 const char kEnableHarfBuzzRenderText[] = "enable-harfbuzz-rendertext"; | 23 const char kEnableHarfBuzzRenderText[] = "enable-harfbuzz-rendertext"; |
| 23 #endif | 24 #endif |
| 24 | 25 |
| 25 void Usage() { | 26 void Usage() { |
| 26 std::cerr << "Launch Mojo applications.\n"; | 27 std::cerr << "Launch Mojo applications.\n"; |
| 27 std::cerr | 28 std::cerr |
| 28 << "Usage: mojo_shell" | 29 << "Usage: mojo_shell" |
| 29 << " [--" << switches::kArgsFor << "=<mojo-app>]" | 30 << " [--" << switches::kArgsFor << "=<mojo-app>]" |
| 30 << " [--" << switches::kContentHandlers << "=<handlers>]" | 31 << " [--" << switches::kContentHandlers << "=<handlers>]" |
| 31 << " [--" << switches::kEnableExternalApplications << "]" | 32 << " [--" << switches::kEnableExternalApplications << "]" |
| 32 << " [--" << switches::kDisableCache << "]" | 33 << " [--" << switches::kDisableCache << "]" |
| 33 << " [--" << switches::kEnableMultiprocess << "]" | 34 << " [--" << switches::kEnableMultiprocess << "]" |
| 34 << " [--" << switches::kOrigin << "=<url-lib-path>]" | 35 << " [--" << switches::kOrigin << "=<url-lib-path>]" |
| 35 << " [--" << switches::kURLMappings << "=from1=to1,from2=to2]" | 36 << " [--" << switches::kURLMappings << "=from1=to1,from2=to2]" |
| 37 << " [--" << switches::kWaitForDebugger << "]" |
| 36 << " <mojo-app> ...\n\n" | 38 << " <mojo-app> ...\n\n" |
| 37 << "A <mojo-app> is a Mojo URL or a Mojo URL and arguments within " | 39 << "A <mojo-app> is a Mojo URL or a Mojo URL and arguments within " |
| 38 << "quotes.\n" | 40 << "quotes.\n" |
| 39 << "Example: mojo_shell \"mojo:js_standalone test.js\".\n" | 41 << "Example: mojo_shell \"mojo:js_standalone test.js\".\n" |
| 40 << "<url-lib-path> is searched for shared libraries named by mojo URLs.\n" | 42 << "<url-lib-path> is searched for shared libraries named by mojo URLs.\n" |
| 41 << "The value of <handlers> is a comma separated list like:\n" | 43 << "The value of <handlers> is a comma separated list like:\n" |
| 42 << "text/html,mojo:html_viewer," | 44 << "text/html,mojo:html_viewer," |
| 43 << "application/javascript,mojo:js_content_handler\n"; | 45 << "application/javascript,mojo:js_content_handler\n"; |
| 44 } | 46 } |
| 45 | 47 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 105 } |
| 104 | 106 |
| 105 message_loop.PostTask( | 107 message_loop.PostTask( |
| 106 FROM_HERE, | 108 FROM_HERE, |
| 107 base::Bind(&mojo::shell::RunCommandLineApps, &shell_context)); | 109 base::Bind(&mojo::shell::RunCommandLineApps, &shell_context)); |
| 108 message_loop.Run(); | 110 message_loop.Run(); |
| 109 } | 111 } |
| 110 } | 112 } |
| 111 return 0; | 113 return 0; |
| 112 } | 114 } |
| OLD | NEW |