Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: ash/mus/window_manager.cc

Issue 2060513002: Tab dragging as implemented as a mus API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: General patch cleanup. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/mus/window_manager.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index 3be7ba8a1dee8a33e9aca00f3fa46e8ac4e5b951..5d9c65bb6154c687b57a039bc88add8ebd16b85e 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"
@@ -27,6 +28,7 @@
#include "components/mus/public/cpp/window_tree_client.h"
#include "components/mus/public/interfaces/mus_constants.mojom.h"
#include "components/mus/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"
@@ -229,6 +231,32 @@ void WindowManager::OnWmNewDisplay(::mus::Window* window,
CreateRootWindowController(window, display);
}
+void WindowManager::OnWmPerformMoveLoop(uint32_t change_id,
+ uint32_t window_id,
+ const gfx::Point& cursor_location) {
+ WmWindowMus* child_window =
+ WmWindowMus::Get(window_tree_client_->GetWindowByServerId(window_id));
+ MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window);
+ handler->AttemptToStartDrag(
+ cursor_location, HTCAPTION,
+ base::Bind(&WindowManager::OnWmMoveLoopCompleted, base::Unretained(this),
+ change_id, window_id));
+}
+
+void WindowManager::OnWmCancelMoveLoop(uint32_t window_id) {
+ WmWindowMus* child_window =
+ WmWindowMus::Get(window_tree_client_->GetWindowByServerId(window_id));
+ MoveEventHandler* handler = MoveEventHandler::GetForWindow(child_window);
+ handler->RevertDrag();
+}
+
+void WindowManager::OnWmMoveLoopCompleted(uint32_t change_id,
+ uint32_t window_id,
+ bool succeeded) {
+ window_manager_client_->OnWmMoveLoopCompleted(change_id, window_id,
+ succeeded);
+}
+
void WindowManager::OnAccelerator(uint32_t id, const ui::Event& event) {
switch (id) {
case kWindowSwitchAccelerator:

Powered by Google App Engine
This is Rietveld 408576698