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