| 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/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 bounds.set_x(show_bounds_in_screen_.x()); | 466 bounds.set_x(show_bounds_in_screen_.x()); |
| 467 resize_widget_->SetBounds(bounds); | 467 resize_widget_->SetBounds(bounds); |
| 468 } | 468 } |
| 469 | 469 |
| 470 void MultiWindowResizeController::CompleteResize() { | 470 void MultiWindowResizeController::CompleteResize() { |
| 471 window_resizer_->CompleteDrag(); | 471 window_resizer_->CompleteDrag(); |
| 472 wm::GetWindowState(window_resizer_->GetTarget())->DeleteDragDetails(); | 472 wm::GetWindowState(window_resizer_->GetTarget())->DeleteDragDetails(); |
| 473 window_resizer_.reset(); | 473 window_resizer_.reset(); |
| 474 | 474 |
| 475 // Mouse may still be over resizer, if not hide. | 475 // Mouse may still be over resizer, if not hide. |
| 476 gfx::Point screen_loc = Shell::GetScreen()->GetCursorScreenPoint(); | 476 gfx::Point screen_loc = gfx::Screen::GetScreen()->GetCursorScreenPoint(); |
| 477 if (!resize_widget_->GetWindowBoundsInScreen().Contains(screen_loc)) { | 477 if (!resize_widget_->GetWindowBoundsInScreen().Contains(screen_loc)) { |
| 478 Hide(); | 478 Hide(); |
| 479 } else { | 479 } else { |
| 480 // If the mouse is over the resizer we need to remove observers on any of | 480 // If the mouse is over the resizer we need to remove observers on any of |
| 481 // the |other_windows|. If we start another resize we'll recalculate the | 481 // the |other_windows|. If we start another resize we'll recalculate the |
| 482 // |other_windows| and invoke AddObserver() as necessary. | 482 // |other_windows| and invoke AddObserver() as necessary. |
| 483 for (size_t i = 0; i < windows_.other_windows.size(); ++i) | 483 for (size_t i = 0; i < windows_.other_windows.size(); ++i) |
| 484 windows_.other_windows[i]->RemoveObserver(this); | 484 windows_.other_windows[i]->RemoveObserver(this); |
| 485 windows_.other_windows.clear(); | 485 windows_.other_windows.clear(); |
| 486 | 486 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 bool MultiWindowResizeController::IsOverComponent( | 571 bool MultiWindowResizeController::IsOverComponent( |
| 572 aura::Window* window, | 572 aura::Window* window, |
| 573 const gfx::Point& location_in_screen, | 573 const gfx::Point& location_in_screen, |
| 574 int component) const { | 574 int component) const { |
| 575 gfx::Point window_loc(location_in_screen); | 575 gfx::Point window_loc(location_in_screen); |
| 576 ::wm::ConvertPointFromScreen(window, &window_loc); | 576 ::wm::ConvertPointFromScreen(window, &window_loc); |
| 577 return window->delegate()->GetNonClientComponent(window_loc) == component; | 577 return window->delegate()->GetNonClientComponent(window_loc) == component; |
| 578 } | 578 } |
| 579 | 579 |
| 580 } // namespace ash | 580 } // namespace ash |
| OLD | NEW |