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
3 // found in the LICENSE file.
5 #include "mojo/shell/run.h"
7 #include "base/command_line.h"
8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h"
10 #include "mojo/shell/app_container.h"
11 #include "mojo/shell/switches.h"
17 void Run(Context* context) {
18 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
19 if (!command_line.HasSwitch(switches::kApp)) {
20 LOG(ERROR) << "No app path specified.";
21 base::MessageLoop::current()->Quit();
25 AppContainer* container = new AppContainer(context);
26 container->Load(GURL(command_line.GetSwitchValueASCII(switches::kApp)));
27 // TODO(abarth): Currently we leak |container|.