16e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
26e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
36e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)// found in the LICENSE file.
46e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
56e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "mojo/examples/apptest/example_service_application.h"
66e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
71320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "mojo/public/c/system/main.h"
86e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "mojo/public/cpp/application/application_connection.h"
91320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "mojo/public/cpp/application/application_runner.h"
106e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)namespace mojo {
126e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)ExampleServiceApplication::ExampleServiceApplication() {}
146e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
156e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)ExampleServiceApplication::~ExampleServiceApplication() {}
166e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
176e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)bool ExampleServiceApplication::ConfigureIncomingConnection(
186e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)    ApplicationConnection* connection) {
196e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  connection->AddService(&example_service_factory_);
206e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)  return true;
216e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}
226e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)
236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}  // namespace mojo
241320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
251320f92c476a1ad9d19dba2a48c72b75566198e9Primiano TucciMojoResult MojoMain(MojoHandle shell_handle) {
261320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  mojo::ApplicationRunner runner(new mojo::ExampleServiceApplication());
271320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  return runner.Run(shell_handle);
281320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}
29