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 #ifndef MOJO_PUBLIC_SHELL_APPLICATION_H_
6 #define MOJO_PUBLIC_SHELL_APPLICATION_H_
10 #include "mojo/public/bindings/remote_ptr.h"
11 #include "mojo/public/shell/service.h"
12 #include "mojo/public/system/core_cpp.h"
13 #include "mojom/shell.h"
17 class Application : public internal::ServiceFactoryBase::Owner {
19 explicit Application(ScopedShellHandle shell_handle);
20 explicit Application(MojoHandle shell_handle);
21 virtual ~Application();
23 // internal::ServiceFactoryBase::Owner methods.
24 // Takes ownership of |service_factory|.
25 virtual void AddServiceFactory(internal::ServiceFactoryBase* service_factory)
27 virtual void RemoveServiceFactory(
28 internal::ServiceFactoryBase* service_factory) MOJO_OVERRIDE;
31 // ShellClient methods.
32 virtual void AcceptConnection(const mojo::String& url,
33 ScopedMessagePipeHandle client_handle)
37 typedef std::vector<internal::ServiceFactoryBase*> ServiceFactoryList;
38 ServiceFactoryList service_factories_;
43 #endif // MOJO_PUBLIC_SHELL_APPLICATION_H_