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/logging.h"
8 #include "mojo/service_manager/service_manager.h"
9 #include "mojo/shell/context.h"
10 #include "mojo/shell/keep_alive.h"
15 class StubServiceProvider
: public InterfaceImpl
<ServiceProvider
> {
17 virtual void ConnectToService(const mojo::String
& service_name
,
18 ScopedMessagePipeHandle client_handle
)
24 void Run(Context
* context
, const std::vector
<GURL
>& app_urls
) {
25 KeepAlive
keep_alive(context
);
27 if (app_urls
.empty()) {
28 LOG(ERROR
) << "No app path specified";
32 for (std::vector
<GURL
>::const_iterator it
= app_urls
.begin();
35 // TODO(davemoore): These leak...need refs to them.
36 StubServiceProvider
* stub_sp
= new StubServiceProvider
;
37 ServiceProviderPtr spp
;
38 BindToProxy(stub_sp
, &spp
);
40 context
->service_manager()->ConnectToApplication(
41 *it
, GURL(), spp
.Pass());