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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 } | 237 } |
238 default: | 238 default: |
239 return ui::ER_UNHANDLED; | 239 return ui::ER_UNHANDLED; |
240 } | 240 } |
241 | 241 |
242 return ui::ER_CONSUMED; | 242 return ui::ER_CONSUMED; |
243 } | 243 } |
244 | 244 |
245 aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop( | 245 aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop( |
246 aura::Window* source, | 246 aura::Window* source, |
247 const gfx::Point& drag_offset) { | 247 const gfx::Vector2d& drag_offset) { |
248 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. | 248 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. |
249 in_move_loop_ = true; | 249 in_move_loop_ = true; |
250 move_cancelled_ = false; | 250 move_cancelled_ = false; |
251 aura::RootWindow* root_window = source->GetRootWindow(); | 251 aura::RootWindow* root_window = source->GetRootWindow(); |
252 DCHECK(root_window); | 252 DCHECK(root_window); |
253 gfx::Point drag_location; | 253 gfx::Point drag_location; |
254 if (aura::Env::GetInstance()->is_touch_down()) { | 254 if (aura::Env::GetInstance()->is_touch_down()) { |
255 in_gesture_resize_ = true; | 255 in_gesture_resize_ = true; |
256 bool has_point = root_window->gesture_recognizer()-> | 256 bool has_point = root_window->gesture_recognizer()-> |
257 GetLastTouchPointForTarget(source, &drag_location); | 257 GetLastTouchPointForTarget(source, &drag_location); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { | 441 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { |
442 // We explicitly don't invoke RevertDrag() since that may do things to window. | 442 // We explicitly don't invoke RevertDrag() since that may do things to window. |
443 // Instead we destroy the resizer. | 443 // Instead we destroy the resizer. |
444 window_resizer_.reset(); | 444 window_resizer_.reset(); |
445 | 445 |
446 // End the move loop. This does nothing if we're not in a move loop. | 446 // End the move loop. This does nothing if we're not in a move loop. |
447 EndMoveLoop(); | 447 EndMoveLoop(); |
448 } | 448 } |
449 | 449 |
450 } // namespace ash | 450 } // namespace ash |
OLD | NEW |