// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_MUS_MUS_APP_H_ #define COMPONENTS_MUS_MUS_APP_H_ #include #include "base/memory/scoped_ptr.h" #include "components/mus/public/interfaces/gpu.mojom.h" #include "components/mus/public/interfaces/window_manager.mojom.h" #include "components/mus/public/interfaces/window_tree.mojom.h" #include "components/mus/public/interfaces/window_tree_host.mojom.h" #include "components/mus/ws/connection_manager_delegate.h" #include "mojo/application/public/cpp/app_lifetime_helper.h" #include "mojo/application/public/cpp/application_delegate.h" #include "mojo/application/public/cpp/interface_factory.h" #include "mojo/common/weak_binding_set.h" #include "mojo/services/tracing/public/cpp/tracing_impl.h" namespace mojo { class ApplicationImpl; } namespace ui { class PlatformEventSource; } namespace mus { class GpuState; class SurfacesState; namespace ws { class ConnectionManager; class ForwardingWindowManager; } class MandolineUIServicesApp : public mojo::ApplicationDelegate, public ws::ConnectionManagerDelegate, public mojo::InterfaceFactory, public mojo::InterfaceFactory, public mojo::InterfaceFactory, public mojom::WindowTreeHostFactory { public: MandolineUIServicesApp(); ~MandolineUIServicesApp() override; private: // ApplicationDelegate: void Initialize(mojo::ApplicationImpl* app) override; bool ConfigureIncomingConnection( mojo::ApplicationConnection* connection) override; // ConnectionManagerDelegate: void OnFirstRootConnectionCreated() override; void OnNoMoreRootConnections() override; ws::ClientConnection* CreateClientConnectionForEmbedAtWindow( ws::ConnectionManager* connection_manager, mojo::InterfaceRequest tree_request, ConnectionSpecificId creator_id, const ws::WindowId& root_id, uint32_t policy_bitmask, mojom::WindowTreeClientPtr client) override; // mojo::InterfaceFactory implementation. void Create(mojo::ApplicationConnection* connection, mojo::InterfaceRequest request) override; // mojo::InterfaceFactory: void Create( mojo::ApplicationConnection* connection, mojo::InterfaceRequest request) override; // mojo::InterfaceFactory implementation. void Create(mojo::ApplicationConnection* connection, mojo::InterfaceRequest request) override; // mojom::WindowTreeHostFactory implementation. void CreateWindowTreeHost(mojo::InterfaceRequest host, mojom::WindowTreeHostClientPtr host_client, mojom::WindowTreeClientPtr tree_client, mojom::WindowManagerPtr window_manager) override; mojo::WeakBindingSet factory_bindings_; scoped_ptr window_manager_impl_; mojo::WeakBindingSet window_manager_bindings_; mojo::ApplicationImpl* app_impl_; scoped_ptr connection_manager_; scoped_refptr gpu_state_; scoped_ptr event_source_; mojo::TracingImpl tracing_; using WindowManagerRequests = std::vector>>; WindowManagerRequests pending_window_manager_requests_; // Surfaces scoped_refptr surfaces_state_; DISALLOW_COPY_AND_ASSIGN(MandolineUIServicesApp); }; } // namespace mus #endif // COMPONENTS_MUS_MUS_APP_H_