| 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 void WindowTreeClientImpl::OnEmbed(ConnectionSpecificId connection_id, | 495 void WindowTreeClientImpl::OnEmbed(ConnectionSpecificId connection_id, |
| 496 mojom::WindowDataPtr root_data, | 496 mojom::WindowDataPtr root_data, |
| 497 mojom::WindowTreePtr tree, | 497 mojom::WindowTreePtr tree, |
| 498 Id focused_window_id, | 498 Id focused_window_id, |
| 499 uint32_t access_policy) { | 499 uint32_t access_policy) { |
| 500 DCHECK(!tree_ptr_); | 500 DCHECK(!tree_ptr_); |
| 501 tree_ptr_ = std::move(tree); | 501 tree_ptr_ = std::move(tree); |
| 502 tree_ptr_.set_connection_error_handler([this]() { delete this; }); | 502 tree_ptr_.set_connection_error_handler([this]() { delete this; }); |
| 503 | 503 |
| 504 if (window_manager_delegate_) { | 504 if (window_manager_delegate_) { |
| 505 tree_ptr_->GetWindowManagerInternalClient(GetProxy( | 505 tree_ptr_->GetWindowManagerClient(GetProxy(&window_manager_internal_client_, |
| 506 &window_manager_internal_client_, tree_ptr_.associated_group())); | 506 tree_ptr_.associated_group())); |
| 507 } | 507 } |
| 508 | 508 |
| 509 OnEmbedImpl(tree_ptr_.get(), connection_id, std::move(root_data), | 509 OnEmbedImpl(tree_ptr_.get(), connection_id, std::move(root_data), |
| 510 focused_window_id, access_policy); | 510 focused_window_id, access_policy); |
| 511 } | 511 } |
| 512 | 512 |
| 513 void WindowTreeClientImpl::OnEmbeddedAppDisconnected(Id window_id) { | 513 void WindowTreeClientImpl::OnEmbeddedAppDisconnected(Id window_id) { |
| 514 Window* window = GetWindowById(window_id); | 514 Window* window = GetWindowById(window_id); |
| 515 if (window) { | 515 if (window) { |
| 516 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(), | 516 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(), |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 | 788 |
| 789 InFlightChange* next_change = GetOldestInFlightChangeMatching(*change); | 789 InFlightChange* next_change = GetOldestInFlightChangeMatching(*change); |
| 790 if (next_change) { | 790 if (next_change) { |
| 791 if (!success) | 791 if (!success) |
| 792 next_change->SetRevertValueFrom(*change); | 792 next_change->SetRevertValueFrom(*change); |
| 793 } else if (!success) { | 793 } else if (!success) { |
| 794 change->Revert(); | 794 change->Revert(); |
| 795 } | 795 } |
| 796 } | 796 } |
| 797 | 797 |
| 798 void WindowTreeClientImpl::GetWindowManagerInternal( | 798 void WindowTreeClientImpl::GetWindowManager( |
| 799 mojo::AssociatedInterfaceRequest<WindowManagerInternal> internal) { | 799 mojo::AssociatedInterfaceRequest<WindowManager> internal) { |
| 800 window_manager_internal_.reset( | 800 window_manager_internal_.reset( |
| 801 new mojo::AssociatedBinding<mojom::WindowManagerInternal>( | 801 new mojo::AssociatedBinding<mojom::WindowManager>(this, |
| 802 this, std::move(internal))); | 802 std::move(internal))); |
| 803 } | 803 } |
| 804 | 804 |
| 805 void WindowTreeClientImpl::RequestClose(uint32_t window_id) { | 805 void WindowTreeClientImpl::RequestClose(uint32_t window_id) { |
| 806 Window* window = GetWindowById(window_id); | 806 Window* window = GetWindowById(window_id); |
| 807 if (!window || !IsRoot(window)) | 807 if (!window || !IsRoot(window)) |
| 808 return; | 808 return; |
| 809 | 809 |
| 810 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(), | 810 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(), |
| 811 OnRequestClose(window)); | 811 OnRequestClose(window)); |
| 812 } | 812 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 window->id()); | 864 window->id()); |
| 865 } | 865 } |
| 866 | 866 |
| 867 void WindowTreeClientImpl::SetFrameDecorationValues( | 867 void WindowTreeClientImpl::SetFrameDecorationValues( |
| 868 mojom::FrameDecorationValuesPtr values) { | 868 mojom::FrameDecorationValuesPtr values) { |
| 869 window_manager_internal_client_->WmSetFrameDecorationValues( | 869 window_manager_internal_client_->WmSetFrameDecorationValues( |
| 870 std::move(values)); | 870 std::move(values)); |
| 871 } | 871 } |
| 872 | 872 |
| 873 } // namespace mus | 873 } // namespace mus |
| OLD | NEW |