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