| 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/resize_shadow_controller.h" | 8 #include "ash/wm/resize_shadow_controller.h" |
| 9 #include "ash/wm/window_resizer.h" | 9 #include "ash/wm/window_resizer.h" |
| 10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 | 390 |
| 391 aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop( | 391 aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop( |
| 392 aura::Window* source, | 392 aura::Window* source, |
| 393 const gfx::Vector2d& drag_offset, | 393 const gfx::Vector2d& drag_offset, |
| 394 aura::client::WindowMoveSource move_source) { | 394 aura::client::WindowMoveSource move_source) { |
| 395 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. | 395 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. |
| 396 aura::Window* root_window = source->GetRootWindow(); | 396 aura::Window* root_window = source->GetRootWindow(); |
| 397 DCHECK(root_window); | 397 DCHECK(root_window); |
| 398 // TODO(tdresser): Use gfx::PointF. See crbug.com/337824. | |
| 399 gfx::Point drag_location; | 398 gfx::Point drag_location; |
| 400 if (move_source == aura::client::WINDOW_MOVE_SOURCE_TOUCH && | 399 if (move_source == aura::client::WINDOW_MOVE_SOURCE_TOUCH && |
| 401 aura::Env::GetInstance()->is_touch_down()) { | 400 aura::Env::GetInstance()->is_touch_down()) { |
| 402 gfx::PointF drag_location_f; | 401 gfx::PointF drag_location_f; |
| 403 bool has_point = ui::GestureRecognizer::Get()-> | 402 bool has_point = ui::GestureRecognizer::Get()-> |
| 404 GetLastTouchPointForTarget(source, &drag_location_f); | 403 GetLastTouchPointForTarget(source, &drag_location_f); |
| 405 drag_location = gfx::ToFlooredPoint(drag_location_f); | 404 drag_location = gfx::ToFlooredPoint(drag_location_f); |
| 406 DCHECK(has_point); | 405 DCHECK(has_point); |
| 407 } else { | 406 } else { |
| 408 drag_location = | 407 drag_location = |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 default: | 624 default: |
| 626 NOTREACHED(); | 625 NOTREACHED(); |
| 627 } | 626 } |
| 628 } | 627 } |
| 629 | 628 |
| 630 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { | 629 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { |
| 631 CompleteDrag(DRAG_RESIZER_WINDOW_DESTROYED); | 630 CompleteDrag(DRAG_RESIZER_WINDOW_DESTROYED); |
| 632 } | 631 } |
| 633 | 632 |
| 634 } // namespace ash | 633 } // namespace ash |
| OLD | NEW |