| 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 "ui/aura/mus/window_tree_client.h" | 5 #include "ui/aura/mus/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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/auto_reset.h" | 13 #include "base/auto_reset.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "services/service_manager/public/cpp/connector.h" | 16 #include "services/service_manager/public/cpp/connector.h" |
| 17 #include "services/ui/public/interfaces/constants.mojom.h" |
| 17 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" | 18 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" |
| 18 #include "ui/aura/client/aura_constants.h" | 19 #include "ui/aura/client/aura_constants.h" |
| 19 #include "ui/aura/client/drag_drop_client.h" | 20 #include "ui/aura/client/drag_drop_client.h" |
| 20 #include "ui/aura/client/transient_window_client.h" | 21 #include "ui/aura/client/transient_window_client.h" |
| 21 #include "ui/aura/mus/capture_synchronizer.h" | 22 #include "ui/aura/mus/capture_synchronizer.h" |
| 22 #include "ui/aura/mus/drag_drop_controller_mus.h" | 23 #include "ui/aura/mus/drag_drop_controller_mus.h" |
| 23 #include "ui/aura/mus/focus_synchronizer.h" | 24 #include "ui/aura/mus/focus_synchronizer.h" |
| 24 #include "ui/aura/mus/in_flight_change.h" | 25 #include "ui/aura/mus/in_flight_change.h" |
| 25 #include "ui/aura/mus/input_method_mus.h" | 26 #include "ui/aura/mus/input_method_mus.h" |
| 26 #include "ui/aura/mus/property_converter.h" | 27 #include "ui/aura/mus/property_converter.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 174 |
| 174 client::GetTransientWindowClient()->RemoveObserver(this); | 175 client::GetTransientWindowClient()->RemoveObserver(this); |
| 175 } | 176 } |
| 176 | 177 |
| 177 void WindowTreeClient::ConnectViaWindowTreeFactory( | 178 void WindowTreeClient::ConnectViaWindowTreeFactory( |
| 178 service_manager::Connector* connector) { | 179 service_manager::Connector* connector) { |
| 179 // The client id doesn't really matter, we use 101 purely for debugging. | 180 // The client id doesn't really matter, we use 101 purely for debugging. |
| 180 client_id_ = 101; | 181 client_id_ = 101; |
| 181 | 182 |
| 182 ui::mojom::WindowTreeFactoryPtr factory; | 183 ui::mojom::WindowTreeFactoryPtr factory; |
| 183 connector->ConnectToInterface("ui", &factory); | 184 connector->ConnectToInterface(ui::mojom::kServiceName, &factory); |
| 184 ui::mojom::WindowTreePtr window_tree; | 185 ui::mojom::WindowTreePtr window_tree; |
| 185 factory->CreateWindowTree(GetProxy(&window_tree), | 186 factory->CreateWindowTree(GetProxy(&window_tree), |
| 186 binding_.CreateInterfacePtrAndBind()); | 187 binding_.CreateInterfacePtrAndBind()); |
| 187 SetWindowTree(std::move(window_tree)); | 188 SetWindowTree(std::move(window_tree)); |
| 188 } | 189 } |
| 189 | 190 |
| 190 void WindowTreeClient::ConnectAsWindowManager( | 191 void WindowTreeClient::ConnectAsWindowManager( |
| 191 service_manager::Connector* connector) { | 192 service_manager::Connector* connector) { |
| 192 DCHECK(window_manager_delegate_); | 193 DCHECK(window_manager_delegate_); |
| 193 | 194 |
| 194 ui::mojom::WindowManagerWindowTreeFactoryPtr factory; | 195 ui::mojom::WindowManagerWindowTreeFactoryPtr factory; |
| 195 connector->ConnectToInterface("ui", &factory); | 196 connector->ConnectToInterface(ui::mojom::kServiceName, &factory); |
| 196 ui::mojom::WindowTreePtr window_tree; | 197 ui::mojom::WindowTreePtr window_tree; |
| 197 factory->CreateWindowTree(GetProxy(&window_tree), | 198 factory->CreateWindowTree(GetProxy(&window_tree), |
| 198 binding_.CreateInterfacePtrAndBind()); | 199 binding_.CreateInterfacePtrAndBind()); |
| 199 SetWindowTree(std::move(window_tree)); | 200 SetWindowTree(std::move(window_tree)); |
| 200 } | 201 } |
| 201 | 202 |
| 202 void WindowTreeClient::SetClientArea( | 203 void WindowTreeClient::SetClientArea( |
| 203 Window* window, | 204 Window* window, |
| 204 const gfx::Insets& client_area, | 205 const gfx::Insets& client_area, |
| 205 const std::vector<gfx::Rect>& additional_client_areas) { | 206 const std::vector<gfx::Rect>& additional_client_areas) { |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1531 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1531 this, capture_synchronizer_.get(), window)); | 1532 this, capture_synchronizer_.get(), window)); |
| 1532 } | 1533 } |
| 1533 | 1534 |
| 1534 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1535 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1535 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1536 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1536 this, focus_synchronizer_.get(), window)); | 1537 this, focus_synchronizer_.get(), window)); |
| 1537 } | 1538 } |
| 1538 | 1539 |
| 1539 } // namespace aura | 1540 } // namespace aura |
| OLD | NEW |