| 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/window_tree_client.h" | 5 #include "components/mus/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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_, | 394 FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_, |
| 395 OnWindowTreeFocusChanged(focused, blurred)); | 395 OnWindowTreeFocusChanged(focused, blurred)); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void WindowTreeClient::AddWindow(Window* window) { | 398 void WindowTreeClient::AddWindow(Window* window) { |
| 399 DCHECK(windows_.find(server_id(window)) == windows_.end()); | 399 DCHECK(windows_.find(server_id(window)) == windows_.end()); |
| 400 windows_[server_id(window)] = window; | 400 windows_[server_id(window)] = window; |
| 401 } | 401 } |
| 402 | 402 |
| 403 void WindowTreeClient::OnWindowDestroying(Window* window) { | 403 void WindowTreeClient::OnWindowDestroying(Window* window) { |
| 404 // TODO(jonross): Also clear the focused window (crbug.com/611983) | |
| 405 if (window == capture_window_) { | 404 if (window == capture_window_) { |
| 406 InFlightCaptureChange reset_change(this, nullptr); | 405 // Normally the queue updates itself upon window destruction. However since |
| 407 ApplyServerChangeToExistingInFlightChange(reset_change); | |
| 408 // Normally just updating the queued changes is sufficient. However since | |
| 409 // |window| is being destroyed, it will not be possible to notify its | 406 // |window| is being destroyed, it will not be possible to notify its |
| 410 // observers of the lost capture. Update local state now. | 407 // observers of the lost capture. Update local state now. |
| 411 LocalSetCapture(nullptr); | 408 LocalSetCapture(nullptr); |
| 412 } | 409 } |
| 410 // For |focused_window_| window destruction clears the entire focus state. |
| 413 } | 411 } |
| 414 | 412 |
| 415 void WindowTreeClient::OnWindowDestroyed(Window* window) { | 413 void WindowTreeClient::OnWindowDestroyed(Window* window) { |
| 416 windows_.erase(server_id(window)); | 414 windows_.erase(server_id(window)); |
| 417 | 415 |
| 418 for (auto& entry : embedded_windows_) { | 416 for (auto& entry : embedded_windows_) { |
| 419 auto it = entry.second.find(window); | 417 auto it = entry.second.find(window); |
| 420 if (it != entry.second.end()) { | 418 if (it != entry.second.end()) { |
| 421 entry.second.erase(it); | 419 entry.second.erase(it); |
| 422 break; | 420 break; |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 Window* window, | 1093 Window* window, |
| 1096 const gfx::Vector2d& offset, | 1094 const gfx::Vector2d& offset, |
| 1097 const gfx::Insets& hit_area) { | 1095 const gfx::Insets& hit_area) { |
| 1098 if (window_manager_internal_client_) { | 1096 if (window_manager_internal_client_) { |
| 1099 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1097 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1100 server_id(window), offset.x(), offset.y(), hit_area); | 1098 server_id(window), offset.x(), offset.y(), hit_area); |
| 1101 } | 1099 } |
| 1102 } | 1100 } |
| 1103 | 1101 |
| 1104 } // namespace mus | 1102 } // namespace mus |
| OLD | NEW |