| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 void WindowTreeClientImpl::WaitForEmbed() { | 188 void WindowTreeClientImpl::WaitForEmbed() { |
| 189 DCHECK(roots_.empty()); | 189 DCHECK(roots_.empty()); |
| 190 // OnEmbed() is the first function called. | 190 // OnEmbed() is the first function called. |
| 191 binding_.WaitForIncomingMethodCall(); | 191 binding_.WaitForIncomingMethodCall(); |
| 192 // TODO(sky): deal with pipe being closed before we get OnEmbed(). | 192 // TODO(sky): deal with pipe being closed before we get OnEmbed(). |
| 193 } | 193 } |
| 194 | 194 |
| 195 void WindowTreeClientImpl::DestroyWindow(Window* window) { | 195 void WindowTreeClientImpl::DestroyWindow(Window* window) { |
| 196 // TODO(jonross): Also clear the focused window (crbug.com/611983) |
| 197 if (window == capture_window_) { |
| 198 InFlightCaptureChange reset_change(this, nullptr); |
| 199 ApplyServerChangeToExistingInFlightChange(reset_change); |
| 200 // Normally just updating the queued changes is sufficient. However since |
| 201 // |window| is being destroyed, it will not be possible to notify its |
| 202 // observers |
| 203 // of the lost capture. Update local state now. |
| 204 LocalSetCapture(nullptr); |
| 205 } |
| 196 DCHECK(tree_); | 206 DCHECK(tree_); |
| 197 const uint32_t change_id = ScheduleInFlightChange(base::WrapUnique( | 207 const uint32_t change_id = ScheduleInFlightChange(base::WrapUnique( |
| 198 new CrashInFlightChange(window, ChangeType::DELETE_WINDOW))); | 208 new CrashInFlightChange(window, ChangeType::DELETE_WINDOW))); |
| 199 tree_->DeleteWindow(change_id, server_id(window)); | 209 tree_->DeleteWindow(change_id, server_id(window)); |
| 200 } | 210 } |
| 201 | 211 |
| 202 void WindowTreeClientImpl::AddChild(Window* parent, Id child_id) { | 212 void WindowTreeClientImpl::AddChild(Window* parent, Id child_id) { |
| 203 DCHECK(tree_); | 213 DCHECK(tree_); |
| 204 const uint32_t change_id = ScheduleInFlightChange( | 214 const uint32_t change_id = ScheduleInFlightChange( |
| 205 base::WrapUnique(new CrashInFlightChange(parent, ChangeType::ADD_CHILD))); | 215 base::WrapUnique(new CrashInFlightChange(parent, ChangeType::ADD_CHILD))); |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 | 1103 |
| 1094 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1104 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1095 Window* window, | 1105 Window* window, |
| 1096 const gfx::Vector2d& offset, | 1106 const gfx::Vector2d& offset, |
| 1097 const gfx::Insets& hit_area) { | 1107 const gfx::Insets& hit_area) { |
| 1098 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1108 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1099 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area)); | 1109 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area)); |
| 1100 } | 1110 } |
| 1101 | 1111 |
| 1102 } // namespace mus | 1112 } // namespace mus |
| OLD | NEW |