OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/frame/move_event_handler.h" | 5 #include "mash/wm/frame/move_event_handler.h" |
6 | 6 |
7 #include "components/mus/public/cpp/window.h" | 7 #include "components/mus/public/cpp/window.h" |
8 #include "components/mus/public/cpp/window_manager_delegate.h" | 8 #include "components/mus/public/cpp/window_manager_delegate.h" |
9 #include "components/mus/public/interfaces/cursor.mojom.h" | 9 #include "components/mus/public/interfaces/cursor.mojom.h" |
10 #include "mash/wm/bridge/wm_window_mus.h" | 10 #include "mash/wm/bridge/wm_window_mus.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return; | 63 return; |
64 | 64 |
65 root_window_->RemoveObserver(this); | 65 root_window_->RemoveObserver(this); |
66 root_window_->RemovePreTargetHandler(this); | 66 root_window_->RemovePreTargetHandler(this); |
67 root_window_ = nullptr; | 67 root_window_ = nullptr; |
68 } | 68 } |
69 | 69 |
70 void MoveEventHandler::OnMouseEvent(ui::MouseEvent* event) { | 70 void MoveEventHandler::OnMouseEvent(ui::MouseEvent* event) { |
71 toplevel_window_event_handler_.OnMouseEvent(event, wm_window_); | 71 toplevel_window_event_handler_.OnMouseEvent(event, wm_window_); |
72 if (!toplevel_window_event_handler_.is_drag_in_progress() && | 72 if (!toplevel_window_event_handler_.is_drag_in_progress() && |
73 event->type() == ui::ET_POINTER_MOVED) { | 73 (event->type() == ui::ET_POINTER_MOVED || |
| 74 event->type() == ui::ET_MOUSE_MOVED)) { |
74 const int hit_test_location = | 75 const int hit_test_location = |
75 wm_window_->GetNonClientComponent(event->location()); | 76 wm_window_->GetNonClientComponent(event->location()); |
76 window_manager_client_->SetNonClientCursor( | 77 window_manager_client_->SetNonClientCursor( |
77 wm_window_->mus_window(), CursorForWindowComponent(hit_test_location)); | 78 wm_window_->mus_window(), CursorForWindowComponent(hit_test_location)); |
78 } | 79 } |
79 } | 80 } |
80 | 81 |
81 void MoveEventHandler::OnGestureEvent(ui::GestureEvent* event) { | 82 void MoveEventHandler::OnGestureEvent(ui::GestureEvent* event) { |
82 toplevel_window_event_handler_.OnGestureEvent(event, wm_window_); | 83 toplevel_window_event_handler_.OnGestureEvent(event, wm_window_); |
83 } | 84 } |
84 | 85 |
85 void MoveEventHandler::OnCancelMode(ui::CancelModeEvent* event) { | 86 void MoveEventHandler::OnCancelMode(ui::CancelModeEvent* event) { |
86 toplevel_window_event_handler_.RevertDrag(); | 87 toplevel_window_event_handler_.RevertDrag(); |
87 } | 88 } |
88 | 89 |
89 void MoveEventHandler::OnWindowDestroying(aura::Window* window) { | 90 void MoveEventHandler::OnWindowDestroying(aura::Window* window) { |
90 DCHECK_EQ(root_window_, window); | 91 DCHECK_EQ(root_window_, window); |
91 Detach(); | 92 Detach(); |
92 } | 93 } |
93 | 94 |
94 } // namespace wm | 95 } // namespace wm |
95 } // namespace mash | 96 } // namespace mash |
OLD | NEW |