Index: ash/wm/workspace/multi_window_resize_controller.cc |
diff --git a/ash/wm/workspace/multi_window_resize_controller.cc b/ash/wm/workspace/multi_window_resize_controller.cc |
index aa23b1674d72d54256a932af53e139c9dda96c7e..d774e58dd678748a11e2aab5956c3bef3f238a42 100644 |
--- a/ash/wm/workspace/multi_window_resize_controller.cc |
+++ b/ash/wm/workspace/multi_window_resize_controller.cc |
@@ -399,6 +399,7 @@ void MultiWindowResizeController::StartResize( |
ConvertPointFromScreen(windows_.window2->parent(), &location_in_parent); |
std::vector<aura::Window*> windows; |
windows.push_back(windows_.window2); |
+ DCHECK(windows_.other_windows.empty()); |
FindWindowsTouching(windows_.window2, windows_.direction, |
&windows_.other_windows); |
for (size_t i = 0; i < windows_.other_windows.size(); ++i) { |
@@ -433,8 +434,16 @@ void MultiWindowResizeController::CompleteResize(int event_flags) { |
// Mouse may still be over resizer, if not hide. |
gfx::Point screen_loc = gfx::Screen::GetCursorScreenPoint(); |
- if (!resize_widget_->GetWindowBoundsInScreen().Contains(screen_loc)) |
+ if (!resize_widget_->GetWindowBoundsInScreen().Contains(screen_loc)) { |
Hide(); |
+ } else { |
+ // If the mouse is over the resizer we need to remove observers on any of |
+ // the |other_windows|. If we start another resize we'll recalculate the |
+ // |other_windows| and invoke AddObserver() as necessary. |
+ for (size_t i = 0; i < windows_.other_windows.size(); ++i) |
+ windows_.other_windows[i]->RemoveObserver(this); |
+ windows_.other_windows.clear(); |
+ } |
} |
void MultiWindowResizeController::CancelResize() { |