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

Side by Side Diff: mash/simple_wm/move_event_handler.cc

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)
Patch Set: OK, it can't be explicit for mac. Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « extensions/shell/browser/shell_desktop_controller_aura.cc ('k') | remoting/host/chromeos/mouse_cursor_monitor_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698