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/property_util.h" | 8 #include "ash/wm/property_util.h" |
9 #include "ash/wm/resize_shadow_controller.h" | 9 #include "ash/wm/resize_shadow_controller.h" |
10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 } | 346 } |
347 // Set the cursor before calling CreateScopedWindowResizer(), as that will | 347 // Set the cursor before calling CreateScopedWindowResizer(), as that will |
348 // eventually call LockCursor() and prevent the cursor from changing. | 348 // eventually call LockCursor() and prevent the cursor from changing. |
349 aura::client::CursorClient* cursor_client = | 349 aura::client::CursorClient* cursor_client = |
350 aura::client::GetCursorClient(root_window); | 350 aura::client::GetCursorClient(root_window); |
351 if (cursor_client) | 351 if (cursor_client) |
352 cursor_client->SetCursor(ui::kCursorPointer); | 352 cursor_client->SetCursor(ui::kCursorPointer); |
353 CreateScopedWindowResizer(source, drag_location, HTCAPTION, move_source); | 353 CreateScopedWindowResizer(source, drag_location, HTCAPTION, move_source); |
354 bool destroyed = false; | 354 bool destroyed = false; |
355 destroyed_ = &destroyed; | 355 destroyed_ = &destroyed; |
356 #if !defined(OS_MACOSX) | |
357 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); | 356 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
358 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); | 357 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); |
359 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 358 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); |
360 quit_closure_ = run_loop.QuitClosure(); | 359 quit_closure_ = run_loop.QuitClosure(); |
361 run_loop.Run(); | 360 run_loop.Run(); |
362 #endif // !defined(OS_MACOSX) | |
363 if (destroyed) | 361 if (destroyed) |
364 return aura::client::MOVE_CANCELED; | 362 return aura::client::MOVE_CANCELED; |
365 destroyed_ = NULL; | 363 destroyed_ = NULL; |
366 in_gesture_drag_ = in_move_loop_ = false; | 364 in_gesture_drag_ = in_move_loop_ = false; |
367 return move_cancelled_ ? aura::client::MOVE_CANCELED : | 365 return move_cancelled_ ? aura::client::MOVE_CANCELED : |
368 aura::client::MOVE_SUCCESSFUL; | 366 aura::client::MOVE_SUCCESSFUL; |
369 } | 367 } |
370 | 368 |
371 void ToplevelWindowEventHandler::EndMoveLoop() { | 369 void ToplevelWindowEventHandler::EndMoveLoop() { |
372 if (!in_move_loop_) | 370 if (!in_move_loop_) |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { | 524 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { |
527 // We explicitly don't invoke RevertDrag() since that may do things to window. | 525 // We explicitly don't invoke RevertDrag() since that may do things to window. |
528 // Instead we destroy the resizer. | 526 // Instead we destroy the resizer. |
529 window_resizer_.reset(); | 527 window_resizer_.reset(); |
530 | 528 |
531 // End the move loop. This does nothing if we're not in a move loop. | 529 // End the move loop. This does nothing if we're not in a move loop. |
532 EndMoveLoop(); | 530 EndMoveLoop(); |
533 } | 531 } |
534 | 532 |
535 } // namespace ash | 533 } // namespace ash |
OLD | NEW |