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

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: . Created 3 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
« ui/aura/mus/window_tree_client.h ('K') | « ui/aura/mus/window_tree_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index 0f7351c738917443789d004d657cba9e57e89b8b..08925d5ffd3e5aec2e45078d5f1f4fe79b2b7d47 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -226,6 +226,20 @@ void WindowTreeClient::ConnectViaWindowTreeFactory() {
SetWindowTree(std::move(window_tree));
}
+void WindowTreeClient::ConnectViaWindowTreeHostFactory() {
+ // The client id doesn't really matter, we use 101 purely for debugging.
+ client_id_ = 101;
+
+ ui::mojom::WindowTreeHostFactoryRegistrarPtr host_factory_registrar;
+ connector_->BindInterface(ui::mojom::kServiceName, &host_factory_registrar);
+
+ ui::mojom::WindowTreePtr window_tree;
+ host_factory_registrar->Register(MakeRequest(&window_tree_host_factory_ptr_),
+ MakeRequest(&window_tree),
+ binding_.CreateInterfacePtrAndBind());
+ SetWindowTree(std::move(window_tree));
+}
+
void WindowTreeClient::ConnectAsWindowManager() {
DCHECK(window_manager_delegate_);
@@ -237,6 +251,10 @@ void WindowTreeClient::ConnectAsWindowManager() {
SetWindowTree(std::move(window_tree));
}
+void WindowTreeClient::CreateHost(ui::mojom::WindowTreeHostRequest host) {
+ window_tree_host_factory_ptr_->CreateWindowTreeHost(std::move(host));
sky 2017/02/28 05:02:22 I suspect that this function shouldn't be called d
fwang 2017/02/28 08:23:53 Mmmh, see the changes in MusDemo for how it is use
sky 2017/02/28 17:34:09 Sure, but doing that is awkward and inconvenient,
tonikitoo 2017/03/01 05:05:44 Hum, I believe I understand sky's point. It might
sky 2017/03/01 17:08:38 I would prefer we go in the right direction, which
+}
+
void WindowTreeClient::SetCanFocus(Window* window, bool can_focus) {
DCHECK(tree_);
DCHECK(window);
@@ -505,7 +523,6 @@ void WindowTreeClient::OnEmbedImpl(ui::mojom::WindowTree* window_tree,
client_id_ = client_id;
WindowTreeConnectionEstablished(window_tree);
- DCHECK(roots_.empty());
fwang 2017/02/28 08:23:53 Should this be kept when we do OnEmbed without con
tonikitoo 2017/03/01 05:05:44 From OnEmbedImpl it is a bit hard. I have moved th
std::unique_ptr<WindowTreeHostMus> window_tree_host =
CreateWindowTreeHost(WindowMusType::EMBED, *root_data, display_id);
@@ -839,8 +856,10 @@ void WindowTreeClient::OnEmbed(ClientSpecificId client_id,
int64_t display_id,
Id focused_window_id,
bool drawn) {
- DCHECK(!tree_ptr_);
- tree_ptr_ = std::move(tree);
+ DCHECK(tree_ptr_);
+ DCHECK(!tree);
+ // No need to set 'tree_ptr_' here because it was already set during
+ // ConnectViaWindowManagerHostFactory.
fwang 2017/02/28 08:23:53 What happens when we do OnEmbed without configurin
tonikitoo 2017/03/01 05:05:44 Done.
is_from_embed_ = true;
« ui/aura/mus/window_tree_client.h ('K') | « ui/aura/mus/window_tree_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698