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_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_CLIENT_FACTORY_H_
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_CLIENT_FACTORY_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "mojo/public/cpp/application/interface_factory.h"
10 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
14 class ViewManagerDelegate;
17 // Add an instance of this class to an incoming connection to allow it to
18 // instantiate ViewManagerClient implementations in response to
19 // ViewManagerClient requests.
20 class ViewManagerClientFactory : public InterfaceFactory<ViewManagerClient> {
22 ViewManagerClientFactory(Shell* shell, ViewManagerDelegate* delegate);
23 ~ViewManagerClientFactory() override;
25 // Creates a ViewManagerClient from the supplied arguments.
26 static scoped_ptr<ViewManagerClient> WeakBindViewManagerToPipe(
27 ScopedMessagePipeHandle handle,
29 ViewManagerDelegate* delegate);
31 // InterfaceFactory<ViewManagerClient> implementation.
32 void Create(ApplicationConnection* connection,
33 InterfaceRequest<ViewManagerClient> request) override;
37 ViewManagerDelegate* delegate_;
42 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_CLIENT_FACTORY_H_