OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | |
6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "mojo/public/cpp/application/application_delegate.h" | |
10 #include "mojo/public/cpp/application/interface_factory.h" | |
11 #include "mojo/public/cpp/bindings/binding.h" | |
12 #include "mojo/public/cpp/bindings/error_handler.h" | |
13 #include "mojo/services/public/interfaces/window_manager/window_manager_internal
.mojom.h" | |
14 #include "mojo/services/view_manager/connection_manager_delegate.h" | |
15 | |
16 namespace mojo { | |
17 namespace service { | |
18 | |
19 class ConnectionManager; | |
20 | |
21 class ViewManagerApp : public ApplicationDelegate, | |
22 public ConnectionManagerDelegate, | |
23 public ErrorHandler, | |
24 public InterfaceFactory<ViewManagerService>, | |
25 public InterfaceFactory<WindowManagerInternalClient> { | |
26 public: | |
27 ViewManagerApp(); | |
28 ~ViewManagerApp() override; | |
29 | |
30 private: | |
31 // ApplicationDelegate: | |
32 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; | |
33 | |
34 // ConnectionManagerDelegate: | |
35 void OnLostConnectionToWindowManager() override; | |
36 ClientConnection* CreateClientConnectionForEmbedAtView( | |
37 ConnectionManager* connection_manager, | |
38 ConnectionSpecificId creator_id, | |
39 const std::string& creator_url, | |
40 const std::string& url, | |
41 const ViewId& root_id) override; | |
42 | |
43 // InterfaceFactory<ViewManagerService>: | |
44 void Create(ApplicationConnection* connection, | |
45 InterfaceRequest<ViewManagerService> request) override; | |
46 | |
47 // InterfaceFactory<WindowManagerInternalClient>: | |
48 void Create(ApplicationConnection* connection, | |
49 InterfaceRequest<WindowManagerInternalClient> request) override; | |
50 | |
51 // ErrorHandler (for |wm_internal_| and |wm_internal_client_binding_|). | |
52 void OnConnectionError() override; | |
53 | |
54 ApplicationConnection* wm_app_connection_; | |
55 scoped_ptr<Binding<WindowManagerInternalClient>> wm_internal_client_binding_; | |
56 WindowManagerInternalPtr wm_internal_; | |
57 scoped_ptr<ConnectionManager> connection_manager_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(ViewManagerApp); | |
60 }; | |
61 | |
62 } // namespace service | |
63 } // namespace mojo | |
64 | |
65 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_APP_H_ | |
OLD | NEW |