| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/workspace/multi_window_resize_controller.h" | 5 #include "ash/wm/workspace/multi_window_resize_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
| 10 #include "ash/wm/workspace/workspace_event_filter.h" | 10 #include "ash/wm/workspace/workspace_event_filter.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 bounds.set_x(show_bounds_.x()); | 420 bounds.set_x(show_bounds_.x()); |
| 421 resize_widget_->SetBounds(bounds); | 421 resize_widget_->SetBounds(bounds); |
| 422 } | 422 } |
| 423 | 423 |
| 424 void MultiWindowResizeController::CompleteResize(int event_flags) { | 424 void MultiWindowResizeController::CompleteResize(int event_flags) { |
| 425 window_resizer_->CompleteDrag(event_flags); | 425 window_resizer_->CompleteDrag(event_flags); |
| 426 window_resizer_.reset(); | 426 window_resizer_.reset(); |
| 427 | 427 |
| 428 // Mouse may still be over resizer, if not hide. | 428 // Mouse may still be over resizer, if not hide. |
| 429 gfx::Point screen_loc = gfx::Screen::GetCursorScreenPoint(); | 429 gfx::Point screen_loc = gfx::Screen::GetCursorScreenPoint(); |
| 430 if (!resize_widget_->GetWindowScreenBounds().Contains(screen_loc)) | 430 if (!resize_widget_->GetWindowBoundsInScreen().Contains(screen_loc)) |
| 431 Hide(); | 431 Hide(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void MultiWindowResizeController::CancelResize() { | 434 void MultiWindowResizeController::CancelResize() { |
| 435 if (!window_resizer_.get()) | 435 if (!window_resizer_.get()) |
| 436 return; // Happens if window was destroyed and we nuked the WindowResizer. | 436 return; // Happens if window was destroyed and we nuked the WindowResizer. |
| 437 window_resizer_->RevertDrag(); | 437 window_resizer_->RevertDrag(); |
| 438 window_resizer_.reset(); | 438 window_resizer_.reset(); |
| 439 Hide(); | 439 Hide(); |
| 440 } | 440 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 459 y = windows_.window1->bounds().bottom() - pref.height() / 2; | 459 y = windows_.window1->bounds().bottom() - pref.height() / 2; |
| 460 } | 460 } |
| 461 return gfx::Rect(x, y, pref.width(), pref.height()); | 461 return gfx::Rect(x, y, pref.width(), pref.height()); |
| 462 } | 462 } |
| 463 | 463 |
| 464 bool MultiWindowResizeController::IsOverWindows( | 464 bool MultiWindowResizeController::IsOverWindows( |
| 465 const gfx::Point& screen_location) const { | 465 const gfx::Point& screen_location) const { |
| 466 if (window_resizer_.get()) | 466 if (window_resizer_.get()) |
| 467 return true; // Ignore hides while actively resizing. | 467 return true; // Ignore hides while actively resizing. |
| 468 | 468 |
| 469 if (resize_widget_->GetWindowScreenBounds().Contains(screen_location)) | 469 if (resize_widget_->GetWindowBoundsInScreen().Contains(screen_location)) |
| 470 return true; | 470 return true; |
| 471 | 471 |
| 472 int hit1, hit2; | 472 int hit1, hit2; |
| 473 if (windows_.direction == TOP_BOTTOM) { | 473 if (windows_.direction == TOP_BOTTOM) { |
| 474 hit1 = HTBOTTOM; | 474 hit1 = HTBOTTOM; |
| 475 hit2 = HTTOP; | 475 hit2 = HTTOP; |
| 476 } else { | 476 } else { |
| 477 hit1 = HTRIGHT; | 477 hit1 = HTRIGHT; |
| 478 hit2 = HTLEFT; | 478 hit2 = HTLEFT; |
| 479 } | 479 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 491 | 491 |
| 492 gfx::Point window_loc(screen_location); | 492 gfx::Point window_loc(screen_location); |
| 493 aura::Window::ConvertPointToWindow( | 493 aura::Window::ConvertPointToWindow( |
| 494 window->GetRootWindow(), window, &window_loc); | 494 window->GetRootWindow(), window, &window_loc); |
| 495 return window->HitTest(window_loc) && | 495 return window->HitTest(window_loc) && |
| 496 window->delegate()->GetNonClientComponent(window_loc) == component; | 496 window->delegate()->GetNonClientComponent(window_loc) == component; |
| 497 } | 497 } |
| 498 | 498 |
| 499 } // namespace internal | 499 } // namespace internal |
| 500 } // namespace ash | 500 } // namespace ash |
| OLD | NEW |