Chromium Code Reviews| 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..b2840dc46d7a796e9e51bec608ab8edc4f765589 100644 |
| --- a/ui/wm/core/transient_window_manager.cc |
| +++ b/ui/wm/core/transient_window_manager.cc |
| @@ -162,8 +162,13 @@ 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. |
| + if (std::find(transient_children_.begin(), transient_children_.end(), |
| + child) != transient_children_.end()) |
|
oshima
2015/11/19 18:05:40
you need {} in this case
|
| + Get(child)->UpdateTransientChildVisibility(visible); |
| + } |
| // Remember the show request in |show_on_parent_visible_| and hide it again |
| // if the following conditions are met |