// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "mojo/public/cpp/application/application_connection.h" #include "mojo/public/cpp/application/application_delegate.h" #include "mojo/services/view_manager/view_manager_init_service_context.h" #include "mojo/services/view_manager/view_manager_init_service_impl.h" namespace mojo { namespace service { class ViewManagerApp : public ApplicationDelegate, public InterfaceFactory { public: ViewManagerApp() {} virtual ~ViewManagerApp() {} virtual bool ConfigureIncomingConnection( ApplicationConnection* connection) OVERRIDE { context_.ConfigureIncomingConnection(connection); // TODO(sky): this needs some sort of authentication as well as making sure // we only ever have one active at a time. connection->AddService(this); return true; } virtual void Create( ApplicationConnection* connection, InterfaceRequest request) OVERRIDE { BindToRequest(new ViewManagerInitServiceImpl(connection, &context_), &request); } private: ViewManagerInitServiceContext context_; DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); }; } // namespace service // static ApplicationDelegate* ApplicationDelegate::Create() { return new mojo::service::ViewManagerApp(); } } // namespace mojo