| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 if (cursor_client) | 403 if (cursor_client) |
| 404 cursor_client->SetCursor(ui::kCursorPointer); | 404 cursor_client->SetCursor(ui::kCursorPointer); |
| 405 if (!AttemptToStartDrag(source, drag_location, HTCAPTION, move_source)) | 405 if (!AttemptToStartDrag(source, drag_location, HTCAPTION, move_source)) |
| 406 return aura::client::MOVE_CANCELED; | 406 return aura::client::MOVE_CANCELED; |
| 407 | 407 |
| 408 in_move_loop_ = true; | 408 in_move_loop_ = true; |
| 409 bool destroyed = false; | 409 bool destroyed = false; |
| 410 destroyed_ = &destroyed; | 410 destroyed_ = &destroyed; |
| 411 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); | 411 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
| 412 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); | 412 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); |
| 413 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 413 base::RunLoop run_loop; |
| 414 quit_closure_ = run_loop.QuitClosure(); | 414 quit_closure_ = run_loop.QuitClosure(); |
| 415 run_loop.Run(); | 415 run_loop.Run(); |
| 416 if (destroyed) | 416 if (destroyed) |
| 417 return aura::client::MOVE_CANCELED; | 417 return aura::client::MOVE_CANCELED; |
| 418 destroyed_ = NULL; | 418 destroyed_ = NULL; |
| 419 in_move_loop_ = false; | 419 in_move_loop_ = false; |
| 420 return drag_reverted_ ? aura::client::MOVE_CANCELED : | 420 return drag_reverted_ ? aura::client::MOVE_CANCELED : |
| 421 aura::client::MOVE_SUCCESSFUL; | 421 aura::client::MOVE_SUCCESSFUL; |
| 422 } | 422 } |
| 423 | 423 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 605 |
| 606 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { | 606 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { |
| 607 // We explicitly don't invoke RevertDrag() since that may do things to window. | 607 // We explicitly don't invoke RevertDrag() since that may do things to window. |
| 608 // Instead we destroy the resizer. | 608 // Instead we destroy the resizer. |
| 609 window_resizer_.reset(); | 609 window_resizer_.reset(); |
| 610 | 610 |
| 611 CompleteDrag(DRAG_REVERT); | 611 CompleteDrag(DRAG_REVERT); |
| 612 } | 612 } |
| 613 | 613 |
| 614 } // namespace ash | 614 } // namespace ash |
| OLD | NEW |