| 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 COMPONENTS_MUS_VIEW_MANAGER_APP_H_ | 5 #ifndef COMPONENTS_MUS_VIEW_MANAGER_APP_H_ |
| 6 #define COMPONENTS_MUS_VIEW_MANAGER_APP_H_ | 6 #define COMPONENTS_MUS_VIEW_MANAGER_APP_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "components/mus/public/interfaces/gpu.mojom.h" | 11 #include "components/mus/public/interfaces/gpu.mojom.h" |
| 12 #include "components/mus/public/interfaces/view_tree.mojom.h" | 12 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 13 #include "components/mus/public/interfaces/view_tree_host.mojom.h" | 13 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
| 14 #include "components/mus/ws/connection_manager_delegate.h" | 14 #include "components/mus/ws/connection_manager_delegate.h" |
| 15 #include "mojo/application/public/cpp/app_lifetime_helper.h" | 15 #include "mojo/application/public/cpp/app_lifetime_helper.h" |
| 16 #include "mojo/application/public/cpp/application_delegate.h" | 16 #include "mojo/application/public/cpp/application_delegate.h" |
| 17 #include "mojo/application/public/cpp/interface_factory.h" | 17 #include "mojo/application/public/cpp/interface_factory.h" |
| 18 #include "mojo/common/tracing_impl.h" | 18 #include "mojo/common/tracing_impl.h" |
| 19 #include "mojo/common/weak_binding_set.h" | 19 #include "mojo/common/weak_binding_set.h" |
| 20 | 20 |
| 21 namespace mojo { | 21 namespace mojo { |
| 22 class ApplicationImpl; | 22 class ApplicationImpl; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace ui { | 25 namespace ui { |
| 26 class PlatformEventSource; | 26 class PlatformEventSource; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace mus { | 29 namespace mus { |
| 30 | 30 |
| 31 class ConnectionManager; | 31 class ConnectionManager; |
| 32 class GpuState; | 32 class GpuState; |
| 33 class SurfacesState; | 33 class SurfacesState; |
| 34 | 34 |
| 35 class MandolineUIServicesApp | 35 class MandolineUIServicesApp |
| 36 : public mojo::ApplicationDelegate, | 36 : public mojo::ApplicationDelegate, |
| 37 public ConnectionManagerDelegate, | 37 public ConnectionManagerDelegate, |
| 38 public mojo::InterfaceFactory<mojo::ViewTreeHostFactory>, | 38 public mojo::InterfaceFactory<mojom::WindowTreeHostFactory>, |
| 39 public mojo::InterfaceFactory<mojo::Gpu>, | 39 public mojo::InterfaceFactory<mojom::Gpu>, |
| 40 public mojo::ViewTreeHostFactory { | 40 public mojom::WindowTreeHostFactory { |
| 41 public: | 41 public: |
| 42 MandolineUIServicesApp(); | 42 MandolineUIServicesApp(); |
| 43 ~MandolineUIServicesApp() override; | 43 ~MandolineUIServicesApp() override; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 // ApplicationDelegate: | 46 // ApplicationDelegate: |
| 47 void Initialize(mojo::ApplicationImpl* app) override; | 47 void Initialize(mojo::ApplicationImpl* app) override; |
| 48 bool ConfigureIncomingConnection( | 48 bool ConfigureIncomingConnection( |
| 49 mojo::ApplicationConnection* connection) override; | 49 mojo::ApplicationConnection* connection) override; |
| 50 | 50 |
| 51 // ConnectionManagerDelegate: | 51 // ConnectionManagerDelegate: |
| 52 void OnNoMoreRootConnections() override; | 52 void OnNoMoreRootConnections() override; |
| 53 ClientConnection* CreateClientConnectionForEmbedAtView( | 53 ClientConnection* CreateClientConnectionForEmbedAtView( |
| 54 ConnectionManager* connection_manager, | 54 ConnectionManager* connection_manager, |
| 55 mojo::InterfaceRequest<mojo::ViewTree> tree_request, | 55 mojo::InterfaceRequest<mojom::WindowTree> tree_request, |
| 56 ConnectionSpecificId creator_id, | 56 ConnectionSpecificId creator_id, |
| 57 mojo::URLRequestPtr request, | 57 mojo::URLRequestPtr request, |
| 58 const ViewId& root_id, | 58 const ViewId& root_id, |
| 59 uint32_t policy_bitmask) override; | 59 uint32_t policy_bitmask) override; |
| 60 ClientConnection* CreateClientConnectionForEmbedAtView( | 60 ClientConnection* CreateClientConnectionForEmbedAtView( |
| 61 ConnectionManager* connection_manager, | 61 ConnectionManager* connection_manager, |
| 62 mojo::InterfaceRequest<mojo::ViewTree> tree_request, | 62 mojo::InterfaceRequest<mojom::WindowTree> tree_request, |
| 63 ConnectionSpecificId creator_id, | 63 ConnectionSpecificId creator_id, |
| 64 const ViewId& root_id, | 64 const ViewId& root_id, |
| 65 uint32_t policy_bitmask, | 65 uint32_t policy_bitmask, |
| 66 mojo::ViewTreeClientPtr client) override; | 66 mojom::WindowTreeClientPtr client) override; |
| 67 | 67 |
| 68 // mojo::InterfaceFactory<mojo::ViewTreeHostFactory>: | 68 // mojo::InterfaceFactory<mojom::WindowTreeHostFactory>: |
| 69 void Create( | 69 void Create( |
| 70 mojo::ApplicationConnection* connection, | 70 mojo::ApplicationConnection* connection, |
| 71 mojo::InterfaceRequest<mojo::ViewTreeHostFactory> request) override; | 71 mojo::InterfaceRequest<mojom::WindowTreeHostFactory> request) override; |
| 72 | 72 |
| 73 // mojo::InterfaceFactory<mojo::Gpu> implementation. | 73 // mojo::InterfaceFactory<mojom::Gpu> implementation. |
| 74 void Create(mojo::ApplicationConnection* connection, | 74 void Create(mojo::ApplicationConnection* connection, |
| 75 mojo::InterfaceRequest<mojo::Gpu> request) override; | 75 mojo::InterfaceRequest<mojom::Gpu> request) override; |
| 76 | 76 |
| 77 // mojo::ViewTreeHostFactory implementation. | 77 // mojom::WindowTreeHostFactory implementation. |
| 78 void CreateWindowTreeHost(mojo::InterfaceRequest<mojo::ViewTreeHost> host, | 78 void CreateWindowTreeHost(mojo::InterfaceRequest<mojom::WindowTreeHost> host, |
| 79 mojo::ViewTreeHostClientPtr host_client, | 79 mojom::WindowTreeHostClientPtr host_client, |
| 80 mojo::ViewTreeClientPtr tree_client) override; | 80 mojom::WindowTreeClientPtr tree_client) override; |
| 81 | 81 |
| 82 mojo::WeakBindingSet<mojo::ViewTreeHostFactory> factory_bindings_; | 82 mojo::WeakBindingSet<mojom::WindowTreeHostFactory> factory_bindings_; |
| 83 mojo::ApplicationImpl* app_impl_; | 83 mojo::ApplicationImpl* app_impl_; |
| 84 scoped_ptr<ConnectionManager> connection_manager_; | 84 scoped_ptr<ConnectionManager> connection_manager_; |
| 85 mojo::TracingImpl tracing_; | 85 mojo::TracingImpl tracing_; |
| 86 scoped_refptr<GpuState> gpu_state_; | 86 scoped_refptr<GpuState> gpu_state_; |
| 87 scoped_ptr<ui::PlatformEventSource> event_source_; | 87 scoped_ptr<ui::PlatformEventSource> event_source_; |
| 88 | 88 |
| 89 // Surfaces | 89 // Surfaces |
| 90 scoped_refptr<SurfacesState> surfaces_state_; | 90 scoped_refptr<SurfacesState> surfaces_state_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); | 92 DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace mus | 95 } // namespace mus |
| 96 | 96 |
| 97 #endif // COMPONENTS_MUS_VIEW_MANAGER_APP_H_ | 97 #endif // COMPONENTS_MUS_VIEW_MANAGER_APP_H_ |
| OLD | NEW |