Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: components/mus/ws/window_tree_host_connection.cc

Issue 1750143002: Changes ownership of WindowTreeHostConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/window_tree_host_connection.h ('k') | components/mus/ws/window_tree_host_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « components/mus/ws/window_tree_host_connection.h ('k') | components/mus/ws/window_tree_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698