| Index: components/mus/ws/window_tree_host_connection.cc
|
| diff --git a/components/mus/ws/window_tree_host_connection.cc b/components/mus/ws/window_tree_host_connection.cc
|
| index 02aad3d20ebfaa2e319d321efdc0f2c6019faef6..12bd6073d6225b42af7ac01db9df3a8ad08c039b 100644
|
| --- a/components/mus/ws/window_tree_host_connection.cc
|
| +++ b/components/mus/ws/window_tree_host_connection.cc
|
| @@ -9,66 +9,26 @@
|
| #include "components/mus/ws/window_tree_impl.h"
|
|
|
| namespace mus {
|
| -
|
| namespace ws {
|
|
|
| -WindowTreeHostConnection::WindowTreeHostConnection(
|
| - scoped_ptr<WindowTreeHostImpl> host_impl,
|
| - ConnectionManager* manager)
|
| - : host_(std::move(host_impl)),
|
| - tree_(nullptr),
|
| - connection_manager_(manager),
|
| - connection_closed_(false) {}
|
| -
|
| -WindowTreeHostConnection::~WindowTreeHostConnection() {
|
| - // If this DCHECK fails then something has tried to delete this object without
|
| - // calling CloseConnection.
|
| - DCHECK(connection_closed_);
|
| -}
|
| -
|
| -void WindowTreeHostConnection::CloseConnection() {
|
| - // A connection error will trigger the display to close and so we want to make
|
| - // sure we signal the ConnectionManager only once.
|
| - if (connection_closed_)
|
| - return;
|
| - // We have to shut down the focus system for this host before destroying the
|
| - // host, as destruction of the window tree will attempt to change focus.
|
| - host_->DestroyFocusController();
|
| - connection_manager()->OnHostConnectionClosed(this);
|
| - connection_closed_ = true;
|
| - delete this;
|
| -}
|
| -
|
| -const WindowTreeImpl* WindowTreeHostConnection::GetWindowTree() const {
|
| - return tree_;
|
| -}
|
| -
|
| -void WindowTreeHostConnection::OnDisplayInitialized() {}
|
| -
|
| -void WindowTreeHostConnection::OnDisplayClosed() {
|
| - CloseConnection();
|
| -}
|
| -
|
| WindowTreeHostConnectionImpl::WindowTreeHostConnectionImpl(
|
| mojo::InterfaceRequest<mojom::WindowTreeHost> request,
|
| - scoped_ptr<WindowTreeHostImpl> host_impl,
|
| + WindowTreeHostImpl* host_impl,
|
| mojom::WindowTreeClientPtr client,
|
| ConnectionManager* manager)
|
| - : WindowTreeHostConnection(std::move(host_impl), manager),
|
| - binding_(window_tree_host(), std::move(request)),
|
| + : connection_manager_(manager),
|
| + binding_(host_impl, std::move(request)),
|
| client_(std::move(client)) {}
|
|
|
| WindowTreeHostConnectionImpl::~WindowTreeHostConnectionImpl() {}
|
|
|
| -void WindowTreeHostConnectionImpl::OnDisplayInitialized() {
|
| - connection_manager()->AddHost(this);
|
| - WindowTreeImpl* tree = connection_manager()->EmbedAtWindow(
|
| - window_tree_host()->root_window(),
|
| - mojom::WindowTree::kAccessPolicyEmbedRoot, std::move(client_));
|
| +WindowTreeImpl* WindowTreeHostConnectionImpl::CreateWindowTree(
|
| + ServerWindow* root) {
|
| + WindowTreeImpl* tree = connection_manager_->EmbedAtWindow(
|
| + root, mojom::WindowTree::kAccessPolicyEmbedRoot, std::move(client_));
|
| tree->ConfigureWindowManager();
|
| - set_window_tree(tree);
|
| + return tree;
|
| }
|
|
|
| } // namespace ws
|
| -
|
| } // namespace mus
|
|
|