| OLD | NEW |
| (Empty) |
| 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/application_manager/application_manager.h" | |
| 9 #include "mojo/shell/context.h" | |
| 10 | |
| 11 namespace mojo { | |
| 12 namespace shell { | |
| 13 | |
| 14 class StubServiceProvider : public InterfaceImpl<ServiceProvider> { | |
| 15 private: | |
| 16 virtual void ConnectToService( | |
| 17 const mojo::String& service_name, | |
| 18 ScopedMessagePipeHandle client_handle) override {} | |
| 19 }; | |
| 20 | |
| 21 | |
| 22 void Run(Context* context, const std::vector<GURL>& app_urls) { | |
| 23 if (app_urls.empty()) { | |
| 24 LOG(ERROR) << "No app path specified"; | |
| 25 return; | |
| 26 } | |
| 27 | |
| 28 for (std::vector<GURL>::const_iterator it = app_urls.begin(); | |
| 29 it != app_urls.end(); | |
| 30 ++it) { | |
| 31 // TODO(davemoore): These leak...need refs to them. | |
| 32 StubServiceProvider* stub_sp = new StubServiceProvider; | |
| 33 ServiceProviderPtr spp; | |
| 34 BindToProxy(stub_sp, &spp); | |
| 35 | |
| 36 context->application_manager()->ConnectToApplication( | |
| 37 *it, GURL(), spp.Pass()); | |
| 38 } | |
| 39 } | |
| 40 | |
| 41 } // namespace shell | |
| 42 } // namespace mojo | |
| OLD | NEW |