Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2509753007: Fixes bug in handling window deletion originating from server (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index 9fbd03f3146a5073be224f61347b7fda5e2a2c63..6ae11599f15d21690585153600802a395c955670 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -592,12 +592,13 @@ void WindowTreeClient::OnWindowMusCreated(WindowMus* window) {
}
}
-void WindowTreeClient::OnWindowMusDestroyed(WindowMus* window) {
+void WindowTreeClient::OnWindowMusDestroyed(WindowMus* window, Origin origin) {
if (focus_synchronizer_->focused_window() == window)
focus_synchronizer_->OnFocusedWindowDestroyed();
// TODO: decide how to deal with windows not owned by this client.
- if (WasCreatedByThisClient(window) || IsRoot(window)) {
+ if (origin == Origin::CLIENT &&
+ (WasCreatedByThisClient(window) || IsRoot(window))) {
const uint32_t change_id =
ScheduleInFlightChange(base::MakeUnique<CrashInFlightChange>(
window, ChangeType::DELETE_WINDOW));
@@ -1030,9 +1031,9 @@ void WindowTreeClient::OnWindowReordered(Id window_id,
}
void WindowTreeClient::OnWindowDeleted(Id window_id) {
- // TODO(sky): decide how best to deal with this. It seems we should let the
- // delegate do the actualy deletion.
- delete GetWindowByServerId(window_id)->GetWindow();
+ WindowMus* window = GetWindowByServerId(window_id);
+ if (window)
+ window->DestroyFromServer();
}
void WindowTreeClient::OnWindowVisibilityChanged(Id window_id, bool visible) {
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698