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