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/services/public/cpp/view_manager/view_manager_client_factory.h"
7 #include "mojo/public/interfaces/application/shell.mojom.h"
8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h"
12 ViewManagerClientFactory::ViewManagerClientFactory(
14 ViewManagerDelegate* delegate)
15 : shell_(shell), delegate_(delegate) {
18 ViewManagerClientFactory::~ViewManagerClientFactory() {
22 scoped_ptr<ViewManagerClient>
23 ViewManagerClientFactory::WeakBindViewManagerToPipe(
24 ScopedMessagePipeHandle handle,
26 ViewManagerDelegate* delegate) {
27 scoped_ptr<ViewManagerClientImpl> client(
28 new ViewManagerClientImpl(delegate, shell));
29 WeakBindToPipe(client.get(), handle.Pass());
33 // InterfaceFactory<ViewManagerClient> implementation.
34 void ViewManagerClientFactory::Create(
35 ApplicationConnection* connection,
36 InterfaceRequest<ViewManagerClient> request) {
37 BindToRequest(new ViewManagerClientImpl(delegate_, shell_), &request);