OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/simple_wm/move_event_handler.h" | 5 #include "mash/simple_wm/move_event_handler.h" |
6 | 6 |
7 #include "mash/simple_wm/move_loop.h" | 7 #include "mash/simple_wm/move_loop.h" |
8 #include "services/ui/public/interfaces/cursor/cursor.mojom.h" | 8 #include "services/ui/public/interfaces/cursor/cursor.mojom.h" |
9 #include "ui/aura/mus/window_port_mus.h" | 9 #include "ui/aura/mus/window_port_mus.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
11 #include "ui/aura/window_delegate.h" | 11 #include "ui/aura/window_delegate.h" |
12 #include "ui/base/hit_test.h" | 12 #include "ui/base/hit_test.h" |
13 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
14 | 14 |
15 namespace simple_wm { | 15 namespace simple_wm { |
16 namespace { | 16 namespace { |
17 | 17 |
18 ui::mojom::CursorType CursorForWindowComponent(int window_component) { | 18 ui::mojom::CursorType CursorForWindowComponent(int window_component) { |
19 switch (window_component) { | 19 switch (window_component) { |
20 case HTBOTTOM: | 20 case HTBOTTOM: |
21 return ui::mojom::CursorType::SOUTH_RESIZE; | 21 return ui::mojom::CursorType::kSouthResize; |
22 case HTBOTTOMLEFT: | 22 case HTBOTTOMLEFT: |
23 return ui::mojom::CursorType::SOUTH_WEST_RESIZE; | 23 return ui::mojom::CursorType::kSouthWestResize; |
24 case HTBOTTOMRIGHT: | 24 case HTBOTTOMRIGHT: |
25 return ui::mojom::CursorType::SOUTH_EAST_RESIZE; | 25 return ui::mojom::CursorType::kSouthEastResize; |
26 case HTLEFT: | 26 case HTLEFT: |
27 return ui::mojom::CursorType::WEST_RESIZE; | 27 return ui::mojom::CursorType::kWestResize; |
28 case HTRIGHT: | 28 case HTRIGHT: |
29 return ui::mojom::CursorType::EAST_RESIZE; | 29 return ui::mojom::CursorType::kEastResize; |
30 case HTTOP: | 30 case HTTOP: |
31 return ui::mojom::CursorType::NORTH_RESIZE; | 31 return ui::mojom::CursorType::kNorthResize; |
32 case HTTOPLEFT: | 32 case HTTOPLEFT: |
33 return ui::mojom::CursorType::NORTH_WEST_RESIZE; | 33 return ui::mojom::CursorType::kNorthWestResize; |
34 case HTTOPRIGHT: | 34 case HTTOPRIGHT: |
35 return ui::mojom::CursorType::NORTH_EAST_RESIZE; | 35 return ui::mojom::CursorType::kNorthEastResize; |
36 default: | 36 default: |
37 return ui::mojom::CursorType::CURSOR_NULL; | 37 return ui::mojom::CursorType::kNull; |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 MoveEventHandler::MoveEventHandler(aura::Window* window) | 43 MoveEventHandler::MoveEventHandler(aura::Window* window) |
44 : window_(window) { | 44 : window_(window) { |
45 window_->AddObserver(this); | 45 window_->AddObserver(this); |
46 window_->AddPreTargetHandler(this); | 46 window_->AddPreTargetHandler(this); |
47 } | 47 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 move_loop_.reset(); | 112 move_loop_.reset(); |
113 event->SetHandled(); | 113 event->SetHandled(); |
114 } | 114 } |
115 | 115 |
116 void MoveEventHandler::OnWindowDestroying(aura::Window* window) { | 116 void MoveEventHandler::OnWindowDestroying(aura::Window* window) { |
117 DCHECK_EQ(window_, window); | 117 DCHECK_EQ(window_, window); |
118 Detach(); | 118 Detach(); |
119 } | 119 } |
120 | 120 |
121 } // namespace simple_wm | 121 } // namespace simple_wm |
OLD | NEW |