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

Unified Diff: mash/wm/frame/move_event_handler.cc

Issue 2029883002: Moves mash/wm into ash/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_static_assert
Patch Set: move comment Created 4 years, 7 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 | « mash/wm/frame/move_event_handler.h ('k') | mash/wm/frame/non_client_frame_view_mash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/frame/move_event_handler.cc
diff --git a/mash/wm/frame/move_event_handler.cc b/mash/wm/frame/move_event_handler.cc
deleted file mode 100644
index aedbfb2d6929b3a83b350c3d40e7dc2c3d34238f..0000000000000000000000000000000000000000
--- a/mash/wm/frame/move_event_handler.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mash/wm/frame/move_event_handler.h"
-
-#include "components/mus/public/cpp/window.h"
-#include "components/mus/public/cpp/window_manager_delegate.h"
-#include "components/mus/public/interfaces/cursor.mojom.h"
-#include "mash/wm/bridge/wm_window_mus.h"
-#include "mash/wm/bridge/wm_window_mus.h"
-#include "ui/aura/window.h"
-#include "ui/base/hit_test.h"
-#include "ui/events/event.h"
-
-namespace mash {
-namespace wm {
-namespace {
-
-mus::mojom::Cursor CursorForWindowComponent(int window_component) {
- switch (window_component) {
- case HTBOTTOM:
- return mus::mojom::Cursor::SOUTH_RESIZE;
- case HTBOTTOMLEFT:
- return mus::mojom::Cursor::SOUTH_WEST_RESIZE;
- case HTBOTTOMRIGHT:
- return mus::mojom::Cursor::SOUTH_EAST_RESIZE;
- case HTLEFT:
- return mus::mojom::Cursor::WEST_RESIZE;
- case HTRIGHT:
- return mus::mojom::Cursor::EAST_RESIZE;
- case HTTOP:
- return mus::mojom::Cursor::NORTH_RESIZE;
- case HTTOPLEFT:
- return mus::mojom::Cursor::NORTH_WEST_RESIZE;
- case HTTOPRIGHT:
- return mus::mojom::Cursor::NORTH_EAST_RESIZE;
- default:
- return mus::mojom::Cursor::CURSOR_NULL;
- }
-}
-
-} // namespace
-
-MoveEventHandler::MoveEventHandler(
- mus::Window* mus_window,
- mus::WindowManagerClient* window_manager_client,
- aura::Window* aura_window)
- : wm_window_(WmWindowMus::Get(mus_window)),
- window_manager_client_(window_manager_client),
- root_window_(aura_window->GetRootWindow()),
- toplevel_window_event_handler_(wm_window_->GetGlobals()) {
- root_window_->AddObserver(this);
- root_window_->AddPreTargetHandler(this);
-}
-
-MoveEventHandler::~MoveEventHandler() {
- Detach();
-}
-
-void MoveEventHandler::Detach() {
- if (!root_window_)
- return;
-
- root_window_->RemoveObserver(this);
- root_window_->RemovePreTargetHandler(this);
- root_window_ = nullptr;
-}
-
-void MoveEventHandler::OnMouseEvent(ui::MouseEvent* event) {
- toplevel_window_event_handler_.OnMouseEvent(event, wm_window_);
- if (!toplevel_window_event_handler_.is_drag_in_progress() &&
- (event->type() == ui::ET_POINTER_MOVED ||
- event->type() == ui::ET_MOUSE_MOVED)) {
- const int hit_test_location =
- wm_window_->GetNonClientComponent(event->location());
- window_manager_client_->SetNonClientCursor(
- wm_window_->mus_window(), CursorForWindowComponent(hit_test_location));
- }
-}
-
-void MoveEventHandler::OnGestureEvent(ui::GestureEvent* event) {
- toplevel_window_event_handler_.OnGestureEvent(event, wm_window_);
-}
-
-void MoveEventHandler::OnCancelMode(ui::CancelModeEvent* event) {
- toplevel_window_event_handler_.RevertDrag();
-}
-
-void MoveEventHandler::OnWindowDestroying(aura::Window* window) {
- DCHECK_EQ(root_window_, window);
- Detach();
-}
-
-} // namespace wm
-} // namespace mash
« no previous file with comments | « mash/wm/frame/move_event_handler.h ('k') | mash/wm/frame/non_client_frame_view_mash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698