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

Unified Diff: ui/wm/core/transient_window_manager.cc

Issue 1464433002: Check that child window was not destroyed inside UpdateTransientChildVisibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 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 | « no previous file | ui/wm/core/transient_window_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/transient_window_manager.cc
diff --git a/ui/wm/core/transient_window_manager.cc b/ui/wm/core/transient_window_manager.cc
index 2ca145d2420dbdd9f9a2fc81fd785e8e64d7a495..dff5bdf046479b5e7d151fa4ce6150ceccead6ad 100644
--- a/ui/wm/core/transient_window_manager.cc
+++ b/ui/wm/core/transient_window_manager.cc
@@ -162,8 +162,14 @@ void TransientWindowManager::OnWindowVisibilityChanged(Window* window,
// If the window has transient children, updates the transient children's
// visiblity as well.
- for (Window* child : transient_children_)
- Get(child)->UpdateTransientChildVisibility(visible);
+ Windows transient_children = transient_children_;
+ for (Window* child : transient_children) {
+ // Child window can be removed inside UpdateTransientChildVisibility call.
sky 2015/11/20 15:56:57 Your description says some of the children can be
oshima 2015/11/20 18:39:18 Sorry if I'm missing something, but the window lif
sky 2015/11/20 18:53:44 The copy of the windows (transient_children) is re
oshima 2015/11/20 19:07:26 If a new window is created at the same address, it
+ if (std::find(transient_children_.begin(), transient_children_.end(),
+ child) != transient_children_.end()) {
+ Get(child)->UpdateTransientChildVisibility(visible);
+ }
sadrul 2015/11/21 08:42:43 Maybe this could use a WindowTracker? e.g. Wind
+ }
// Remember the show request in |show_on_parent_visible_| and hide it again
// if the following conditions are met
« no previous file with comments | « no previous file | ui/wm/core/transient_window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698