OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" | 5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 void WindowTreeClientImpl::ConnectViaWindowTreeFactory( | 160 void WindowTreeClientImpl::ConnectViaWindowTreeFactory( |
161 mojo::Shell* shell) { | 161 mojo::Shell* shell) { |
162 // Clients created with no root shouldn't delete automatically. | 162 // Clients created with no root shouldn't delete automatically. |
163 delete_on_no_roots_ = false; | 163 delete_on_no_roots_ = false; |
164 | 164 |
165 // The connection id doesn't really matter, we use 101 purely for debugging. | 165 // The connection id doesn't really matter, we use 101 purely for debugging. |
166 connection_id_ = 101; | 166 connection_id_ = 101; |
167 | 167 |
168 mojom::WindowTreeFactoryPtr factory; | 168 mojom::WindowTreeFactoryPtr factory; |
169 shell->ConnectToService("mojo:mus", &factory); | 169 shell->ConnectToInterface("mojo:mus", &factory); |
170 factory->CreateWindowTree(GetProxy(&tree_ptr_), | 170 factory->CreateWindowTree(GetProxy(&tree_ptr_), |
171 binding_.CreateInterfacePtrAndBind()); | 171 binding_.CreateInterfacePtrAndBind()); |
172 tree_ = tree_ptr_.get(); | 172 tree_ = tree_ptr_.get(); |
173 } | 173 } |
174 | 174 |
175 void WindowTreeClientImpl::WaitForEmbed() { | 175 void WindowTreeClientImpl::WaitForEmbed() { |
176 DCHECK(roots_.empty()); | 176 DCHECK(roots_.empty()); |
177 // OnEmbed() is the first function called. | 177 // OnEmbed() is the first function called. |
178 binding_.WaitForIncomingMethodCall(); | 178 binding_.WaitForIncomingMethodCall(); |
179 // TODO(sky): deal with pipe being closed before we get OnEmbed(). | 179 // TODO(sky): deal with pipe being closed before we get OnEmbed(). |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 | 929 |
930 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( | 930 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( |
931 Window* window, | 931 Window* window, |
932 const gfx::Vector2d& offset, | 932 const gfx::Vector2d& offset, |
933 const gfx::Insets& hit_area) { | 933 const gfx::Insets& hit_area) { |
934 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 934 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
935 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area)); | 935 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area)); |
936 } | 936 } |
937 | 937 |
938 } // namespace mus | 938 } // namespace mus |
OLD | NEW |