Index: ash/mus/window_manager.cc |
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc |
index 715d740ff71f043bf4bd9dcb54c15cbc44a31dcf..d0755a5720894670eba318a6c3ad8483b6ed84b9 100644 |
--- a/ash/mus/window_manager.cc |
+++ b/ash/mus/window_manager.cc |
@@ -12,6 +12,7 @@ |
#include "ash/mus/bridge/wm_lookup_mus.h" |
#include "ash/mus/bridge/wm_shell_mus.h" |
#include "ash/mus/bridge/wm_window_mus.h" |
+#include "ash/mus/frame/move_event_handler.h" |
#include "ash/mus/non_client_frame_controller.h" |
#include "ash/mus/property_util.h" |
#include "ash/mus/root_window_controller.h" |
@@ -26,6 +27,7 @@ |
#include "services/ui/public/cpp/window_tree_client.h" |
#include "services/ui/public/interfaces/mus_constants.mojom.h" |
#include "services/ui/public/interfaces/window_manager.mojom.h" |
+#include "ui/base/hit_test.h" |
#include "ui/events/mojo/event.mojom.h" |
#include "ui/views/mus/screen_mus.h" |
@@ -235,11 +237,26 @@ void WindowManager::OnWmPerformMoveLoop( |
::ui::mojom::MoveLoopSource source, |
const gfx::Point& cursor_location, |
const base::Callback<void(bool)>& on_done) { |
- NOTIMPLEMENTED(); |
+ WmWindowMus* child_window = WmWindowMus::Get(window); |
+ MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window); |
+ if (!handler) { |
+ on_done.Run(false); |
+ return; |
+ } |
+ |
+ DCHECK(!handler->IsDragInProgress()); |
+ aura::client::WindowMoveSource aura_source = |
+ source == ::ui::mojom::MoveLoopSource::MOUSE |
+ ? aura::client::WINDOW_MOVE_SOURCE_MOUSE |
+ : aura::client::WINDOW_MOVE_SOURCE_TOUCH; |
+ handler->AttemptToStartDrag(cursor_location, HTCAPTION, aura_source, on_done); |
} |
void WindowManager::OnWmCancelMoveLoop(::ui::Window* window) { |
- NOTIMPLEMENTED(); |
+ WmWindowMus* child_window = WmWindowMus::Get(window); |
+ MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window); |
+ if (handler) |
+ handler->RevertDrag(); |
} |
ui::mojom::EventResult WindowManager::OnAccelerator(uint32_t id, |
@@ -253,6 +270,7 @@ ui::mojom::EventResult WindowManager::OnAccelerator(uint32_t id, |
OnAccelerator(id, event)); |
break; |
} |
+ |
return ui::mojom::EventResult::HANDLED; |
} |