OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CLIENT_FACTORY_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CLIENT_FACTORY_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CLIENT_FACTORY_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CLIENT_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "mojo/public/cpp/application/interface_factory.h" | 8 #include "mojo/public/cpp/application/interface_factory.h" |
10 #include "view_manager/public/interfaces/view_manager.mojom.h" | 9 #include "view_manager/public/interfaces/view_manager.mojom.h" |
11 | 10 |
12 namespace mojo { | 11 namespace mojo { |
13 | 12 |
14 class ViewManagerDelegate; | 13 class ViewManagerDelegate; |
15 class Shell; | 14 class Shell; |
16 | 15 |
17 // Add an instance of this class to an incoming connection to allow it to | 16 // Add an instance of this class to an incoming connection to allow it to |
18 // instantiate ViewManagerClient implementations in response to | 17 // instantiate ViewManagerClient implementations in response to |
19 // ViewManagerClient requests. | 18 // ViewManagerClient requests. |
20 class ViewManagerClientFactory : public InterfaceFactory<ViewManagerClient> { | 19 class ViewManagerClientFactory : public InterfaceFactory<ViewManagerClient> { |
21 public: | 20 public: |
22 ViewManagerClientFactory(Shell* shell, ViewManagerDelegate* delegate); | 21 ViewManagerClientFactory(Shell* shell, ViewManagerDelegate* delegate); |
23 ~ViewManagerClientFactory() override; | 22 ~ViewManagerClientFactory() override; |
24 | 23 |
25 // Creates a ViewManagerClient from the supplied arguments. | 24 // Creates a ViewManagerClient from the supplied arguments. Returns ownership |
26 static scoped_ptr<ViewManagerClient> WeakBindViewManagerToPipe( | 25 // to the caller. |
| 26 static ViewManagerClient* WeakBindViewManagerToPipe( |
27 InterfaceRequest<ViewManagerClient> request, | 27 InterfaceRequest<ViewManagerClient> request, |
28 ViewManagerServicePtr view_manager_service, | 28 ViewManagerServicePtr view_manager_service, |
29 Shell* shell, | 29 Shell* shell, |
30 ViewManagerDelegate* delegate); | 30 ViewManagerDelegate* delegate); |
31 | 31 |
32 // InterfaceFactory<ViewManagerClient> implementation. | 32 // InterfaceFactory<ViewManagerClient> implementation. |
33 void Create(ApplicationConnection* connection, | 33 void Create(ApplicationConnection* connection, |
34 InterfaceRequest<ViewManagerClient> request) override; | 34 InterfaceRequest<ViewManagerClient> request) override; |
35 | 35 |
36 private: | 36 private: |
37 Shell* shell_; | 37 Shell* shell_; |
38 ViewManagerDelegate* delegate_; | 38 ViewManagerDelegate* delegate_; |
39 }; | 39 }; |
40 | 40 |
41 } // namespace mojo | 41 } // namespace mojo |
42 | 42 |
43 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CLIENT_FACTORY_H_ | 43 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_CLIENT_FACTORY_H_ |
OLD | NEW |