| 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/window_state.h" | 8 #include "ash/wm/window_state.h" |
| 9 #include "ash/wm/window_state_aura.h" | 9 #include "ash/wm/window_state_aura.h" |
| 10 #include "ash/wm_window.h" | 10 #include "ash/wm_window.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 drag_location = | 63 drag_location = |
| 64 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 64 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
| 65 aura::Window::ConvertPointToTarget(root_window, source->parent(), | 65 aura::Window::ConvertPointToTarget(root_window, source->parent(), |
| 66 &drag_location); | 66 &drag_location); |
| 67 } | 67 } |
| 68 // Set the cursor before calling AttemptToStartDrag(), as that will | 68 // Set the cursor before calling AttemptToStartDrag(), as that will |
| 69 // eventually call LockCursor() and prevent the cursor from changing. | 69 // eventually call LockCursor() and prevent the cursor from changing. |
| 70 aura::client::CursorClient* cursor_client = | 70 aura::client::CursorClient* cursor_client = |
| 71 aura::client::GetCursorClient(root_window); | 71 aura::client::GetCursorClient(root_window); |
| 72 if (cursor_client) | 72 if (cursor_client) |
| 73 cursor_client->SetCursor(ui::kCursorPointer); | 73 cursor_client->SetCursor(ui::CursorType::kPointer); |
| 74 | 74 |
| 75 base::RunLoop run_loop; | 75 base::RunLoop run_loop; |
| 76 | 76 |
| 77 wm::WmToplevelWindowEventHandler::DragResult result = | 77 wm::WmToplevelWindowEventHandler::DragResult result = |
| 78 wm::WmToplevelWindowEventHandler::DragResult::SUCCESS; | 78 wm::WmToplevelWindowEventHandler::DragResult::SUCCESS; |
| 79 if (!wm_toplevel_window_event_handler_.AttemptToStartDrag( | 79 if (!wm_toplevel_window_event_handler_.AttemptToStartDrag( |
| 80 WmWindow::Get(source), drag_location, HTCAPTION, move_source, | 80 WmWindow::Get(source), drag_location, HTCAPTION, move_source, |
| 81 base::Bind(&ToplevelWindowEventHandler::OnDragCompleted, | 81 base::Bind(&ToplevelWindowEventHandler::OnDragCompleted, |
| 82 weak_factory_.GetWeakPtr(), &result, &run_loop))) { | 82 weak_factory_.GetWeakPtr(), &result, &run_loop))) { |
| 83 return aura::client::MOVE_CANCELED; | 83 return aura::client::MOVE_CANCELED; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 void ToplevelWindowEventHandler::OnDragCompleted( | 119 void ToplevelWindowEventHandler::OnDragCompleted( |
| 120 wm::WmToplevelWindowEventHandler::DragResult* result_return_value, | 120 wm::WmToplevelWindowEventHandler::DragResult* result_return_value, |
| 121 base::RunLoop* run_loop, | 121 base::RunLoop* run_loop, |
| 122 wm::WmToplevelWindowEventHandler::DragResult result) { | 122 wm::WmToplevelWindowEventHandler::DragResult result) { |
| 123 *result_return_value = result; | 123 *result_return_value = result; |
| 124 run_loop->Quit(); | 124 run_loop->Quit(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace ash | 127 } // namespace ash |
| OLD | NEW |