Index: mojo/services/html_viewer/html_viewer.cc |
diff --git a/mojo/services/html_viewer/html_viewer.cc b/mojo/services/html_viewer/html_viewer.cc |
index 201343c2712b254cfa76e69e32fd108f256fb8ae..abe6379a7d2990892c0444a47ac653a6473f995b 100644 |
--- a/mojo/services/html_viewer/html_viewer.cc |
+++ b/mojo/services/html_viewer/html_viewer.cc |
@@ -44,7 +44,8 @@ using mojo::URLResponsePtr; |
namespace html_viewer { |
-// Switches for html_viewer. |
+// Switches for html_viewer to be used with "--args-for". For example: |
+// --args-for='mojo:html_viewer --enable-mojo-media-renderer' |
// Enable MediaRenderer in media pipeline instead of using the internal |
// media::Renderer implementation. |
@@ -182,7 +183,16 @@ class HTMLViewer : public mojo::ApplicationDelegate, |
ui::RegisterPathProvider(); |
+ base::CommandLine::StringVector command_line_args; |
+#if defined(OS_WIN) |
+ for (const auto& arg : app->args()) |
+ command_line_args.push_back(base::UTF8ToUTF16(arg)); |
+#elif defined(OS_POSIX) |
+ command_line_args = app->args(); |
+#endif |
+ |
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
+ command_line->InitFromArgv(command_line_args); |
logging::LoggingSettings settings; |
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |