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

Unified Diff: ash/mus/move_event_handler.cc

Issue 2285703003: Moves WorkspaceEventHandler to ash/common (Closed)
Patch Set: merge 2 trunk Created 4 years, 4 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
« no previous file with comments | « ash/mus/move_event_handler.h ('k') | ash/wm/workspace/multi_window_resize_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/move_event_handler.cc
diff --git a/ash/mus/move_event_handler.cc b/ash/mus/move_event_handler.cc
index 469273bbd76f1f6c653060954b4a52f0676d97cd..644c5954f4fce34a7c99864663af29a67508267c 100644
--- a/ash/mus/move_event_handler.cc
+++ b/ash/mus/move_event_handler.cc
@@ -5,6 +5,7 @@
#include "ash/mus/move_event_handler.h"
#include "ash/mus/bridge/wm_window_mus.h"
+#include "ash/mus/bridge/workspace_event_handler_mus.h"
#include "services/ui/public/cpp/window.h"
#include "services/ui/public/cpp/window_manager_delegate.h"
#include "services/ui/public/cpp/window_property.h"
@@ -110,6 +111,13 @@ void MoveEventHandler::Detach() {
root_window_ = nullptr;
}
+WorkspaceEventHandlerMus* MoveEventHandler::GetWorkspaceEventHandlerMus() {
+ if (!wm_window_->GetParent())
+ return nullptr;
+
+ return WorkspaceEventHandlerMus::Get(wm_window_->mus_window()->parent());
+}
+
void MoveEventHandler::OnMouseEvent(ui::MouseEvent* event) {
toplevel_window_event_handler_.OnMouseEvent(event, wm_window_);
if (!toplevel_window_event_handler_.is_drag_in_progress() &&
@@ -120,10 +128,20 @@ void MoveEventHandler::OnMouseEvent(ui::MouseEvent* event) {
window_manager_client_->SetNonClientCursor(
wm_window_->mus_window(), CursorForWindowComponent(hit_test_location));
}
+
+ WorkspaceEventHandlerMus* workspace_event_handler =
+ GetWorkspaceEventHandlerMus();
+ if (workspace_event_handler)
+ workspace_event_handler->OnMouseEvent(event, wm_window_);
}
void MoveEventHandler::OnGestureEvent(ui::GestureEvent* event) {
toplevel_window_event_handler_.OnGestureEvent(event, wm_window_);
+
+ WorkspaceEventHandlerMus* workspace_event_handler =
+ GetWorkspaceEventHandlerMus();
+ if (workspace_event_handler)
+ workspace_event_handler->OnGestureEvent(event, wm_window_);
}
void MoveEventHandler::OnCancelMode(ui::CancelModeEvent* event) {
« no previous file with comments | « ash/mus/move_event_handler.h ('k') | ash/wm/workspace/multi_window_resize_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698