| 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/aura/wm_window_aura.h" |
| 8 #include "ash/wm/common/wm_event.h" | 9 #include "ash/wm/common/wm_event.h" |
| 9 #include "ash/wm/resize_shadow_controller.h" | 10 #include "ash/wm/resize_shadow_controller.h" |
| 10 #include "ash/wm/window_resizer.h" | 11 #include "ash/wm/window_resizer.h" |
| 11 #include "ash/wm/window_state.h" | 12 #include "ash/wm/window_state.h" |
| 12 #include "ash/wm/window_state_aura.h" | 13 #include "ash/wm/window_state_aura.h" |
| 13 #include "ash/wm/window_state_observer.h" | 14 #include "ash/wm/window_state_observer.h" |
| 14 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
| 15 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 16 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 17 #include "ui/aura/client/cursor_client.h" | 18 #include "ui/aura/client/cursor_client.h" |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 CompleteDrag(DRAG_REVERT); | 445 CompleteDrag(DRAG_REVERT); |
| 445 } | 446 } |
| 446 | 447 |
| 447 bool ToplevelWindowEventHandler::AttemptToStartDrag( | 448 bool ToplevelWindowEventHandler::AttemptToStartDrag( |
| 448 aura::Window* window, | 449 aura::Window* window, |
| 449 const gfx::Point& point_in_parent, | 450 const gfx::Point& point_in_parent, |
| 450 int window_component, | 451 int window_component, |
| 451 aura::client::WindowMoveSource source) { | 452 aura::client::WindowMoveSource source) { |
| 452 if (window_resizer_.get()) | 453 if (window_resizer_.get()) |
| 453 return false; | 454 return false; |
| 454 WindowResizer* resizer = CreateWindowResizer(window, point_in_parent, | 455 WindowResizer* resizer = |
| 455 window_component, source).release(); | 456 CreateWindowResizer(wm::WmWindowAura::Get(window), point_in_parent, |
| 457 window_component, source) |
| 458 .release(); |
| 456 if (!resizer) | 459 if (!resizer) |
| 457 return false; | 460 return false; |
| 458 | 461 |
| 459 window_resizer_.reset(new ScopedWindowResizer(this, resizer)); | 462 window_resizer_.reset(new ScopedWindowResizer(this, resizer)); |
| 460 | 463 |
| 461 pre_drag_window_bounds_ = window->bounds(); | 464 pre_drag_window_bounds_ = window->bounds(); |
| 462 in_gesture_drag_ = (source == aura::client::WINDOW_MOVE_SOURCE_TOUCH); | 465 in_gesture_drag_ = (source == aura::client::WINDOW_MOVE_SOURCE_TOUCH); |
| 463 return true; | 466 return true; |
| 464 } | 467 } |
| 465 | 468 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 default: | 632 default: |
| 630 NOTREACHED(); | 633 NOTREACHED(); |
| 631 } | 634 } |
| 632 } | 635 } |
| 633 | 636 |
| 634 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { | 637 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { |
| 635 CompleteDrag(DRAG_RESIZER_WINDOW_DESTROYED); | 638 CompleteDrag(DRAG_RESIZER_WINDOW_DESTROYED); |
| 636 } | 639 } |
| 637 | 640 |
| 638 } // namespace ash | 641 } // namespace ash |
| OLD | NEW |