• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #include "mojo/shell/run.h"
6 
7 #include "base/logging.h"
8 #include "mojo/service_manager/service_manager.h"
9 #include "mojo/shell/context.h"
10 #include "mojo/shell/keep_alive.h"
11 
12 namespace mojo {
13 namespace shell {
14 
Run(Context * context,const std::vector<GURL> & app_urls)15 void Run(Context* context, const std::vector<GURL>& app_urls) {
16   KeepAlive keep_alive(context);
17 
18   if (app_urls.empty()) {
19     LOG(ERROR) << "No app path specified";
20     return;
21   }
22 
23   for (std::vector<GURL>::const_iterator it = app_urls.begin();
24        it != app_urls.end();
25        ++it) {
26     ScopedMessagePipeHandle no_handle;
27     context->service_manager()->ConnectToService(
28         *it, std::string(), no_handle.Pass(), GURL());
29   }
30 }
31 
32 }  // namespace shell
33 }  // namespace mojo
34