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

Unified Diff: ash/wm/workspace/multi_window_resize_controller.cc

Issue 10830148: Fixes bug in MultiWindowResizeController where it wasn't removing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months 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 | ash/wm/workspace/multi_window_resize_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | ash/wm/workspace/multi_window_resize_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698