| 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> |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 client::GetTransientWindowClient()->RemoveObserver(this); | 202 client::GetTransientWindowClient()->RemoveObserver(this); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void WindowTreeClient::ConnectViaWindowTreeFactory() { | 205 void WindowTreeClient::ConnectViaWindowTreeFactory() { |
| 206 // The client id doesn't really matter, we use 101 purely for debugging. | 206 // The client id doesn't really matter, we use 101 purely for debugging. |
| 207 client_id_ = 101; | 207 client_id_ = 101; |
| 208 | 208 |
| 209 ui::mojom::WindowTreeFactoryPtr factory; | 209 ui::mojom::WindowTreeFactoryPtr factory; |
| 210 connector_->ConnectToInterface(ui::mojom::kServiceName, &factory); | 210 connector_->ConnectToInterface(ui::mojom::kServiceName, &factory); |
| 211 ui::mojom::WindowTreePtr window_tree; | 211 ui::mojom::WindowTreePtr window_tree; |
| 212 factory->CreateWindowTree(GetProxy(&window_tree), | 212 factory->CreateWindowTree(MakeRequest(&window_tree), |
| 213 binding_.CreateInterfacePtrAndBind()); | 213 binding_.CreateInterfacePtrAndBind()); |
| 214 SetWindowTree(std::move(window_tree)); | 214 SetWindowTree(std::move(window_tree)); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void WindowTreeClient::ConnectAsWindowManager() { | 217 void WindowTreeClient::ConnectAsWindowManager() { |
| 218 DCHECK(window_manager_delegate_); | 218 DCHECK(window_manager_delegate_); |
| 219 | 219 |
| 220 ui::mojom::WindowManagerWindowTreeFactoryPtr factory; | 220 ui::mojom::WindowManagerWindowTreeFactoryPtr factory; |
| 221 connector_->ConnectToInterface(ui::mojom::kServiceName, &factory); | 221 connector_->ConnectToInterface(ui::mojom::kServiceName, &factory); |
| 222 ui::mojom::WindowTreePtr window_tree; | 222 ui::mojom::WindowTreePtr window_tree; |
| 223 factory->CreateWindowTree(GetProxy(&window_tree), | 223 factory->CreateWindowTree(MakeRequest(&window_tree), |
| 224 binding_.CreateInterfacePtrAndBind()); | 224 binding_.CreateInterfacePtrAndBind()); |
| 225 SetWindowTree(std::move(window_tree)); | 225 SetWindowTree(std::move(window_tree)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 client::CaptureClient* WindowTreeClient::GetCaptureClient() { | 228 client::CaptureClient* WindowTreeClient::GetCaptureClient() { |
| 229 return delegate_->GetCaptureClient(); | 229 return delegate_->GetCaptureClient(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void WindowTreeClient::SetCanFocus(Window* window, bool can_focus) { | 232 void WindowTreeClient::SetCanFocus(Window* window, bool can_focus) { |
| 233 DCHECK(tree_); | 233 DCHECK(tree_); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 tree_ptr_ = std::move(window_tree_ptr); | 438 tree_ptr_ = std::move(window_tree_ptr); |
| 439 WindowTreeConnectionEstablished(tree_ptr_.get()); | 439 WindowTreeConnectionEstablished(tree_ptr_.get()); |
| 440 tree_ptr_->GetCursorLocationMemory( | 440 tree_ptr_->GetCursorLocationMemory( |
| 441 base::Bind(&WindowTreeClient::OnReceivedCursorLocationMemory, | 441 base::Bind(&WindowTreeClient::OnReceivedCursorLocationMemory, |
| 442 weak_factory_.GetWeakPtr())); | 442 weak_factory_.GetWeakPtr())); |
| 443 | 443 |
| 444 tree_ptr_.set_connection_error_handler(base::Bind( | 444 tree_ptr_.set_connection_error_handler(base::Bind( |
| 445 &WindowTreeClient::OnConnectionLost, weak_factory_.GetWeakPtr())); | 445 &WindowTreeClient::OnConnectionLost, weak_factory_.GetWeakPtr())); |
| 446 | 446 |
| 447 if (window_manager_delegate_) { | 447 if (window_manager_delegate_) { |
| 448 tree_ptr_->GetWindowManagerClient(GetProxy(&window_manager_internal_client_, | 448 tree_ptr_->GetWindowManagerClient(MakeRequest( |
| 449 tree_ptr_.associated_group())); | 449 &window_manager_internal_client_, tree_ptr_.associated_group())); |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 | 452 |
| 453 void WindowTreeClient::WindowTreeConnectionEstablished( | 453 void WindowTreeClient::WindowTreeConnectionEstablished( |
| 454 ui::mojom::WindowTree* window_tree) { | 454 ui::mojom::WindowTree* window_tree) { |
| 455 tree_ = window_tree; | 455 tree_ = window_tree; |
| 456 | 456 |
| 457 drag_drop_controller_ = base::MakeUnique<DragDropControllerMus>(this, tree_); | 457 drag_drop_controller_ = base::MakeUnique<DragDropControllerMus>(this, tree_); |
| 458 capture_synchronizer_ = | 458 capture_synchronizer_ = |
| 459 base::MakeUnique<CaptureSynchronizer>(this, tree_, GetCaptureClient()); | 459 base::MakeUnique<CaptureSynchronizer>(this, tree_, GetCaptureClient()); |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 ui::mojom::WindowTreePtr tree, | 836 ui::mojom::WindowTreePtr tree, |
| 837 int64_t display_id, | 837 int64_t display_id, |
| 838 Id focused_window_id, | 838 Id focused_window_id, |
| 839 bool drawn) { | 839 bool drawn) { |
| 840 DCHECK(!tree_ptr_); | 840 DCHECK(!tree_ptr_); |
| 841 tree_ptr_ = std::move(tree); | 841 tree_ptr_ = std::move(tree); |
| 842 | 842 |
| 843 is_from_embed_ = true; | 843 is_from_embed_ = true; |
| 844 | 844 |
| 845 if (window_manager_delegate_) { | 845 if (window_manager_delegate_) { |
| 846 tree_ptr_->GetWindowManagerClient(GetProxy(&window_manager_internal_client_, | 846 tree_ptr_->GetWindowManagerClient(MakeRequest( |
| 847 tree_ptr_.associated_group())); | 847 &window_manager_internal_client_, tree_ptr_.associated_group())); |
| 848 } | 848 } |
| 849 | 849 |
| 850 OnEmbedImpl(tree_ptr_.get(), client_id, std::move(root_data), display_id, | 850 OnEmbedImpl(tree_ptr_.get(), client_id, std::move(root_data), display_id, |
| 851 focused_window_id, drawn); | 851 focused_window_id, drawn); |
| 852 } | 852 } |
| 853 | 853 |
| 854 void WindowTreeClient::OnEmbeddedAppDisconnected(Id window_id) { | 854 void WindowTreeClient::OnEmbeddedAppDisconnected(Id window_id) { |
| 855 WindowMus* window = GetWindowByServerId(window_id); | 855 WindowMus* window = GetWindowByServerId(window_id); |
| 856 if (window) | 856 if (window) |
| 857 window->NotifyEmbeddedAppDisconnected(); | 857 window->NotifyEmbeddedAppDisconnected(); |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1690 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1691 this, capture_synchronizer_.get(), window)); | 1691 this, capture_synchronizer_.get(), window)); |
| 1692 } | 1692 } |
| 1693 | 1693 |
| 1694 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1694 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1695 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1695 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1696 this, focus_synchronizer_.get(), window)); | 1696 this, focus_synchronizer_.get(), window)); |
| 1697 } | 1697 } |
| 1698 | 1698 |
| 1699 } // namespace aura | 1699 } // namespace aura |
| OLD | NEW |