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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 void MultiWindowResizeController::OnWindowDestroying( | 229 void MultiWindowResizeController::OnWindowDestroying( |
230 aura::Window* window) { | 230 aura::Window* window) { |
231 // Have to explicitly reset the WindowResizer, otherwise Hide() does nothing. | 231 // Have to explicitly reset the WindowResizer, otherwise Hide() does nothing. |
232 window_resizer_.reset(); | 232 window_resizer_.reset(); |
233 Hide(); | 233 Hide(); |
234 } | 234 } |
235 | 235 |
236 MultiWindowResizeController::ResizeWindows | 236 MultiWindowResizeController::ResizeWindows |
237 MultiWindowResizeController::DetermineWindowsFromScreenPoint( | 237 MultiWindowResizeController::DetermineWindowsFromScreenPoint( |
238 aura::Window* window) const { | 238 aura::Window* window) const { |
239 gfx::Point mouse_location( | 239 gfx::Point mouse_location(gfx::Screen::GetScreen()->GetCursorScreenPoint()); |
240 gfx::Screen::GetScreenFor(window)->GetCursorScreenPoint()); | |
241 ::wm::ConvertPointFromScreen(window, &mouse_location); | 240 ::wm::ConvertPointFromScreen(window, &mouse_location); |
242 const int component = | 241 const int component = |
243 window->delegate()->GetNonClientComponent(mouse_location); | 242 window->delegate()->GetNonClientComponent(mouse_location); |
244 return DetermineWindows(window, component, mouse_location); | 243 return DetermineWindows(window, component, mouse_location); |
245 } | 244 } |
246 | 245 |
247 void MultiWindowResizeController::CreateMouseWatcher() { | 246 void MultiWindowResizeController::CreateMouseWatcher() { |
248 mouse_watcher_.reset(new views::MouseWatcher( | 247 mouse_watcher_.reset(new views::MouseWatcher( |
249 new ResizeMouseWatcherHost(this), this)); | 248 new ResizeMouseWatcherHost(this), this)); |
250 mouse_watcher_->set_notify_on_exit_time( | 249 mouse_watcher_->set_notify_on_exit_time( |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 bool MultiWindowResizeController::IsOverComponent( | 571 bool MultiWindowResizeController::IsOverComponent( |
573 aura::Window* window, | 572 aura::Window* window, |
574 const gfx::Point& location_in_screen, | 573 const gfx::Point& location_in_screen, |
575 int component) const { | 574 int component) const { |
576 gfx::Point window_loc(location_in_screen); | 575 gfx::Point window_loc(location_in_screen); |
577 ::wm::ConvertPointFromScreen(window, &window_loc); | 576 ::wm::ConvertPointFromScreen(window, &window_loc); |
578 return window->delegate()->GetNonClientComponent(window_loc) == component; | 577 return window->delegate()->GetNonClientComponent(window_loc) == component; |
579 } | 578 } |
580 | 579 |
581 } // namespace ash | 580 } // namespace ash |
OLD | NEW |