| Index: mojo/shell/desktop/mojo_main.cc
|
| diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc
|
| index c1e796aeabe0e5c4c370e6af0148d6d92a24b153..f2ef50af27d406b1336b659e04c1a2ee88ac887a 100644
|
| --- a/mojo/shell/desktop/mojo_main.cc
|
| +++ b/mojo/shell/desktop/mojo_main.cc
|
| @@ -14,6 +14,7 @@
|
| #include "mojo/shell/context.h"
|
| #include "mojo/shell/init.h"
|
| #include "mojo/shell/run.h"
|
| +#include "mojo/shell/switches.h"
|
| #include "ui/gl/gl_surface.h"
|
|
|
| namespace {
|
| @@ -67,8 +68,26 @@ int main(int argc, char** argv) {
|
| gfx::GLSurface::InitializeOneOff();
|
|
|
| base::MessageLoop message_loop;
|
| - mojo::shell::Context context;
|
| - message_loop.PostTask(FROM_HERE, base::Bind(mojo::shell::Run, &context));
|
| + mojo::shell::Context shell_context;
|
| +
|
| + const base::CommandLine& command_line =
|
| + *base::CommandLine::ForCurrentProcess();
|
| + if (command_line.HasSwitch(switches::kOrigin)) {
|
| + shell_context.set_mojo_origin(
|
| + command_line.GetSwitchValueASCII(switches::kOrigin));
|
| + }
|
| +
|
| + std::vector<GURL> app_urls;
|
| + base::CommandLine::StringVector args = command_line.GetArgs();
|
| + for (base::CommandLine::StringVector::const_iterator it = args.begin();
|
| + it != args.end();
|
| + ++it)
|
| + app_urls.push_back(GURL(*it));
|
| +
|
| + message_loop.PostTask(FROM_HERE,
|
| + base::Bind(mojo::shell::Run,
|
| + &shell_context,
|
| + app_urls));
|
|
|
| message_loop.Run();
|
| }
|
|
|