Chromium Code Reviews| Index: ash/common/wm/overview/window_selector.cc |
| diff --git a/ash/common/wm/overview/window_selector.cc b/ash/common/wm/overview/window_selector.cc |
| index b24142b14492ce3febf825e12b5aea27378d7c57..c1464f308e431b4fdfa0ad85d6155520d4b4ab56 100644 |
| --- a/ash/common/wm/overview/window_selector.cc |
| +++ b/ash/common/wm/overview/window_selector.cc |
| @@ -285,7 +285,8 @@ WindowSelector::WindowSelector(WindowSelectorDelegate* delegate) |
| text_filter_string_length_(0), |
| num_times_textfield_cleared_(0), |
| restoring_minimized_windows_(false), |
| - text_filter_bottom_(0) { |
| + text_filter_bottom_(0), |
| + shutting_down_(false) { |
| DCHECK(delegate_); |
| } |
| @@ -381,6 +382,7 @@ void WindowSelector::Init(const WindowList& windows) { |
| // may cause other, unrelated classes, (ie PanelLayoutManager) to make indirect |
| // calls to restoring_minimized_windows() on a partially destructed object. |
| void WindowSelector::Shutdown() { |
| + shutting_down_ = true; |
|
oshima
2016/08/08 22:47:37
can we just remove observer?
varkha
2016/08/08 23:45:35
Yes, I considered this before but thought for some
|
| size_t remaining_items = 0; |
| for (std::unique_ptr<WindowGrid>& window_grid : grid_list_) { |
| for (WindowSelectorItem* window_selector_item : window_grid->window_list()) |
| @@ -553,12 +555,10 @@ void WindowSelector::OnDisplayRemoved(const display::Display& display) { |
| void WindowSelector::OnDisplayMetricsChanged(const display::Display& display, |
| uint32_t metrics) { |
| - // If only the work area changes, there is no need to reposition windows in |
| - // overview. |
| - if (metrics != DISPLAY_METRIC_WORK_AREA) { |
| - PositionWindows(/* animate */ false); |
| - RepositionTextFilterOnDisplayMetricsChange(); |
| - } |
| + if (shutting_down_) |
| + return; |
| + PositionWindows(/* animate */ false); |
| + RepositionTextFilterOnDisplayMetricsChange(); |
| } |
| void WindowSelector::OnWindowTreeChanged(WmWindow* window, |