// 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_WS_CLIENT_CONNECTION_H_ #define COMPONENTS_MUS_WS_CLIENT_CONNECTION_H_ #include "base/memory/scoped_ptr.h" #include "components/mus/public/interfaces/window_tree.mojom.h" #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" namespace mus { namespace ws { class ConnectionManager; class WindowTreeImpl; // ClientConnection encapsulates the state needed for a single client connected // to the window manager. class ClientConnection { public: ClientConnection(scoped_ptr service, mojom::WindowTreeClient* client); virtual ~ClientConnection(); WindowTreeImpl* service() { return service_.get(); } const WindowTreeImpl* service() const { return service_.get(); } mojom::WindowTreeClient* client() { return client_; } private: scoped_ptr service_; mojom::WindowTreeClient* client_; DISALLOW_COPY_AND_ASSIGN(ClientConnection); }; // Bindings implementation of ClientConnection. class DefaultClientConnection : public ClientConnection { public: DefaultClientConnection( scoped_ptr service_impl, ConnectionManager* connection_manager, mojo::InterfaceRequest service_request, mojom::WindowTreeClientPtr client); ~DefaultClientConnection() override; private: ConnectionManager* connection_manager_; mojo::Binding binding_; mojom::WindowTreeClientPtr client_; DISALLOW_COPY_AND_ASSIGN(DefaultClientConnection); }; } // namespace ws } // namespace mus #endif // COMPONENTS_MUS_WS_CLIENT_CONNECTION_H_