| 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/toplevel_window_event_handler.h" | 5 #include "ash/wm/toplevel_window_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/property_util.h" | 8 #include "ash/wm/property_util.h" |
| 9 #include "ash/wm/resize_shadow_controller.h" | 9 #include "ash/wm/resize_shadow_controller.h" |
| 10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 234 } |
| 235 default: | 235 default: |
| 236 return ui::ER_UNHANDLED; | 236 return ui::ER_UNHANDLED; |
| 237 } | 237 } |
| 238 | 238 |
| 239 return ui::ER_CONSUMED; | 239 return ui::ER_CONSUMED; |
| 240 } | 240 } |
| 241 | 241 |
| 242 aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop( | 242 aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop( |
| 243 aura::Window* source, | 243 aura::Window* source, |
| 244 const gfx::Point& drag_offset) { | 244 const gfx::Vector2d& drag_offset) { |
| 245 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. | 245 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. |
| 246 in_move_loop_ = true; | 246 in_move_loop_ = true; |
| 247 move_cancelled_ = false; | 247 move_cancelled_ = false; |
| 248 aura::RootWindow* root_window = source->GetRootWindow(); | 248 aura::RootWindow* root_window = source->GetRootWindow(); |
| 249 DCHECK(root_window); | 249 DCHECK(root_window); |
| 250 gfx::Point drag_location; | 250 gfx::Point drag_location; |
| 251 if (aura::Env::GetInstance()->is_touch_down()) { | 251 if (aura::Env::GetInstance()->is_touch_down()) { |
| 252 in_gesture_resize_ = true; | 252 in_gesture_resize_ = true; |
| 253 bool has_point = root_window->gesture_recognizer()-> | 253 bool has_point = root_window->gesture_recognizer()-> |
| 254 GetLastTouchPointForTarget(source, &drag_location); | 254 GetLastTouchPointForTarget(source, &drag_location); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { | 433 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { |
| 434 // We explicitly don't invoke RevertDrag() since that may do things to window. | 434 // We explicitly don't invoke RevertDrag() since that may do things to window. |
| 435 // Instead we destroy the resizer. | 435 // Instead we destroy the resizer. |
| 436 window_resizer_.reset(); | 436 window_resizer_.reset(); |
| 437 | 437 |
| 438 // End the move loop. This does nothing if we're not in a move loop. | 438 // End the move loop. This does nothing if we're not in a move loop. |
| 439 EndMoveLoop(); | 439 EndMoveLoop(); |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace ash | 442 } // namespace ash |
| OLD | NEW |