| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // other random windows that it doesn't own. | 112 // other random windows that it doesn't own. |
| 113 // NOTE: we manually delete as we're a friend. | 113 // NOTE: we manually delete as we're a friend. |
| 114 while (!tracker.windows().empty()) | 114 while (!tracker.windows().empty()) |
| 115 delete tracker.windows().front(); | 115 delete tracker.windows().front(); |
| 116 | 116 |
| 117 FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_, | 117 FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_, |
| 118 OnDidDestroyClient(this)); | 118 OnDidDestroyClient(this)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void WindowTreeClient::ConnectViaWindowTreeFactory( | 121 void WindowTreeClient::ConnectViaWindowTreeFactory( |
| 122 shell::Connector* connector) { | 122 service_manager::Connector* connector) { |
| 123 // The client id doesn't really matter, we use 101 purely for debugging. | 123 // The client id doesn't really matter, we use 101 purely for debugging. |
| 124 client_id_ = 101; | 124 client_id_ = 101; |
| 125 | 125 |
| 126 mojom::WindowTreeFactoryPtr factory; | 126 mojom::WindowTreeFactoryPtr factory; |
| 127 connector->ConnectToInterface("service:ui", &factory); | 127 connector->ConnectToInterface("service:ui", &factory); |
| 128 mojom::WindowTreePtr window_tree; | 128 mojom::WindowTreePtr window_tree; |
| 129 factory->CreateWindowTree(GetProxy(&window_tree), | 129 factory->CreateWindowTree(GetProxy(&window_tree), |
| 130 binding_.CreateInterfacePtrAndBind()); | 130 binding_.CreateInterfacePtrAndBind()); |
| 131 SetWindowTree(std::move(window_tree)); | 131 SetWindowTree(std::move(window_tree)); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void WindowTreeClient::ConnectAsWindowManager(shell::Connector* connector) { | 134 void WindowTreeClient::ConnectAsWindowManager( |
| 135 service_manager::Connector* connector) { |
| 135 DCHECK(window_manager_delegate_); | 136 DCHECK(window_manager_delegate_); |
| 136 | 137 |
| 137 mojom::WindowManagerWindowTreeFactoryPtr factory; | 138 mojom::WindowManagerWindowTreeFactoryPtr factory; |
| 138 connector->ConnectToInterface("service:ui", &factory); | 139 connector->ConnectToInterface("service:ui", &factory); |
| 139 mojom::WindowTreePtr window_tree; | 140 mojom::WindowTreePtr window_tree; |
| 140 factory->CreateWindowTree(GetProxy(&window_tree), | 141 factory->CreateWindowTree(GetProxy(&window_tree), |
| 141 binding_.CreateInterfacePtrAndBind()); | 142 binding_.CreateInterfacePtrAndBind()); |
| 142 SetWindowTree(std::move(window_tree)); | 143 SetWindowTree(std::move(window_tree)); |
| 143 } | 144 } |
| 144 | 145 |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 Window* window, | 1432 Window* window, |
| 1432 const gfx::Vector2d& offset, | 1433 const gfx::Vector2d& offset, |
| 1433 const gfx::Insets& hit_area) { | 1434 const gfx::Insets& hit_area) { |
| 1434 if (window_manager_internal_client_) { | 1435 if (window_manager_internal_client_) { |
| 1435 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1436 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1436 server_id(window), offset.x(), offset.y(), hit_area); | 1437 server_id(window), offset.x(), offset.y(), hit_area); |
| 1437 } | 1438 } |
| 1438 } | 1439 } |
| 1439 | 1440 |
| 1440 } // namespace ui | 1441 } // namespace ui |
| OLD | NEW |