1 // Copyright 2014 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/examples/echo/echo_service.mojom.h"
6 #include "mojo/public/cpp/application/application_connection.h"
7 #include "mojo/public/cpp/application/application_delegate.h"
8 #include "mojo/public/cpp/application/interface_factory_impl.h"
13 class EchoServiceImpl : public InterfaceImpl<EchoService> {
15 virtual void EchoString(
17 const Callback<void(String)>& callback) MOJO_OVERRIDE {
22 class EchoServiceDelegate : public ApplicationDelegate {
24 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
26 connection->AddService(&echo_service_factory_);
31 InterfaceFactoryImpl<EchoServiceImpl> echo_service_factory_;
34 } // namespace examples
37 ApplicationDelegate* ApplicationDelegate::Create() {
38 return new examples::EchoServiceDelegate();