| 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 "services/ui/public/cpp/window_tree_client.h" | 5 #include "services/ui/public/cpp/window_tree_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 for (auto& observer : observers_) | 144 for (auto& observer : observers_) |
| 145 observer.OnDidDestroyClient(this); | 145 observer.OnDidDestroyClient(this); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void WindowTreeClient::ConnectViaWindowTreeFactory( | 148 void WindowTreeClient::ConnectViaWindowTreeFactory( |
| 149 service_manager::Connector* connector) { | 149 service_manager::Connector* connector) { |
| 150 // The client id doesn't really matter, we use 101 purely for debugging. | 150 // The client id doesn't really matter, we use 101 purely for debugging. |
| 151 client_id_ = 101; | 151 client_id_ = 101; |
| 152 | 152 |
| 153 mojom::WindowTreeFactoryPtr factory; | 153 mojom::WindowTreeFactoryPtr factory; |
| 154 connector->ConnectToInterface(ui::mojom::kServiceName, &factory); | 154 connector->BindInterface(ui::mojom::kServiceName, &factory); |
| 155 mojom::WindowTreePtr window_tree; | 155 mojom::WindowTreePtr window_tree; |
| 156 factory->CreateWindowTree(MakeRequest(&window_tree), | 156 factory->CreateWindowTree(MakeRequest(&window_tree), |
| 157 binding_.CreateInterfacePtrAndBind()); | 157 binding_.CreateInterfacePtrAndBind()); |
| 158 SetWindowTree(std::move(window_tree)); | 158 SetWindowTree(std::move(window_tree)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void WindowTreeClient::ConnectAsWindowManager( | 161 void WindowTreeClient::ConnectAsWindowManager( |
| 162 service_manager::Connector* connector) { | 162 service_manager::Connector* connector) { |
| 163 DCHECK(window_manager_delegate_); | 163 DCHECK(window_manager_delegate_); |
| 164 | 164 |
| 165 mojom::WindowManagerWindowTreeFactoryPtr factory; | 165 mojom::WindowManagerWindowTreeFactoryPtr factory; |
| 166 connector->ConnectToInterface(ui::mojom::kServiceName, &factory); | 166 connector->BindInterface(ui::mojom::kServiceName, &factory); |
| 167 mojom::WindowTreePtr window_tree; | 167 mojom::WindowTreePtr window_tree; |
| 168 factory->CreateWindowTree(MakeRequest(&window_tree), | 168 factory->CreateWindowTree(MakeRequest(&window_tree), |
| 169 binding_.CreateInterfacePtrAndBind()); | 169 binding_.CreateInterfacePtrAndBind()); |
| 170 SetWindowTree(std::move(window_tree)); | 170 SetWindowTree(std::move(window_tree)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void WindowTreeClient::WaitForEmbed() { | 173 void WindowTreeClient::WaitForEmbed() { |
| 174 DCHECK(roots_.empty()); | 174 DCHECK(roots_.empty()); |
| 175 // OnEmbed() is the first function called. | 175 // OnEmbed() is the first function called. |
| 176 binding_.WaitForIncomingMethodCall(); | 176 binding_.WaitForIncomingMethodCall(); |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 // TODO(riajiang): Figure out if |offset| needs to be converted. | 1471 // TODO(riajiang): Figure out if |offset| needs to be converted. |
| 1472 // (http://crbugs.com/646932) | 1472 // (http://crbugs.com/646932) |
| 1473 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1473 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1474 server_id(window), offset.x(), offset.y(), | 1474 server_id(window), offset.x(), offset.y(), |
| 1475 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), | 1475 gfx::ConvertInsetsToDIP(ScaleFactorForDisplay(window->display_id()), |
| 1476 hit_area)); | 1476 hit_area)); |
| 1477 } | 1477 } |
| 1478 } | 1478 } |
| 1479 | 1479 |
| 1480 } // namespace ui | 1480 } // namespace ui |
| OLD | NEW |