| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 drag_reverted_ = (status == DRAG_REVERT); | 380 drag_reverted_ = (status == DRAG_REVERT); |
| 381 | 381 |
| 382 in_gesture_drag_ = false; | 382 in_gesture_drag_ = false; |
| 383 if (in_move_loop_) | 383 if (in_move_loop_) |
| 384 quit_closure_.Run(); | 384 quit_closure_.Run(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void ToplevelWindowEventHandler::HandleMousePressed( | 387 void ToplevelWindowEventHandler::HandleMousePressed( |
| 388 aura::Window* target, | 388 aura::Window* target, |
| 389 ui::MouseEvent* event) { | 389 ui::MouseEvent* event) { |
| 390 // Move/size operations are initiated post-target handling to give the target | 390 if (event->phase() != ui::EP_PRETARGET) |
| 391 // an opportunity to cancel this default behavior by returning ER_HANDLED. | |
| 392 if (ui::EventCanceledDefaultHandling(*event)) | |
| 393 return; | 391 return; |
| 394 | 392 |
| 395 // We also update the current window component here because for the | 393 // We also update the current window component here because for the |
| 396 // mouse-drag-release-press case, where the mouse is released and | 394 // mouse-drag-release-press case, where the mouse is released and |
| 397 // pressed without mouse move event. | 395 // pressed without mouse move event. |
| 398 int component = | 396 int component = |
| 399 target->delegate()->GetNonClientComponent(event->location()); | 397 target->delegate()->GetNonClientComponent(event->location()); |
| 400 if ((event->flags() & | 398 if ((event->flags() & |
| 401 (ui::EF_IS_DOUBLE_CLICK | ui::EF_IS_TRIPLE_CLICK)) == 0 && | 399 (ui::EF_IS_DOUBLE_CLICK | ui::EF_IS_TRIPLE_CLICK)) == 0 && |
| 402 WindowResizer::GetBoundsChangeForWindowComponent(component)) { | 400 WindowResizer::GetBoundsChangeForWindowComponent(component)) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 526 |
| 529 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { | 527 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { |
| 530 // We explicitly don't invoke RevertDrag() since that may do things to window. | 528 // We explicitly don't invoke RevertDrag() since that may do things to window. |
| 531 // Instead we destroy the resizer. | 529 // Instead we destroy the resizer. |
| 532 window_resizer_.reset(); | 530 window_resizer_.reset(); |
| 533 | 531 |
| 534 CompleteDrag(DRAG_REVERT, 0); | 532 CompleteDrag(DRAG_REVERT, 0); |
| 535 } | 533 } |
| 536 | 534 |
| 537 } // namespace ash | 535 } // namespace ash |
| OLD | NEW |