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

Side by Side Diff: services/ui/ws/event_dispatcher.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
« no previous file with comments | « services/ui/ws/drag_controller_unittest.cc ('k') | services/ui/ws/platform_display_default.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "services/ui/ws/event_dispatcher.h" 5 #include "services/ui/ws/event_dispatcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // shouldn't cause problems because we already read the cursor before we 84 // shouldn't cause problems because we already read the cursor before we
85 // process any events in views during window construction. 85 // process any events in views during window construction.
86 delegate_->OnMouseCursorLocationChanged(screen_location); 86 delegate_->OnMouseCursorLocationChanged(screen_location);
87 } 87 }
88 88
89 ui::mojom::CursorType EventDispatcher::GetCurrentMouseCursor() const { 89 ui::mojom::CursorType EventDispatcher::GetCurrentMouseCursor() const {
90 if (drag_controller_) 90 if (drag_controller_)
91 return drag_controller_->current_cursor(); 91 return drag_controller_->current_cursor();
92 92
93 if (!mouse_cursor_source_window_) 93 if (!mouse_cursor_source_window_)
94 return ui::mojom::CursorType::POINTER; 94 return ui::mojom::CursorType::kPointer;
95 95
96 if (mouse_cursor_in_non_client_area_) 96 if (mouse_cursor_in_non_client_area_)
97 return mouse_cursor_source_window_->non_client_cursor(); 97 return mouse_cursor_source_window_->non_client_cursor();
98 98
99 const ServerWindow* window = GetWindowForMouseCursor(); 99 const ServerWindow* window = GetWindowForMouseCursor();
100 return window ? window->cursor() : ui::mojom::CursorType::POINTER; 100 return window ? window->cursor() : ui::mojom::CursorType::kPointer;
101 } 101 }
102 102
103 bool EventDispatcher::SetCaptureWindow(ServerWindow* window, 103 bool EventDispatcher::SetCaptureWindow(ServerWindow* window,
104 ClientSpecificId client_id) { 104 ClientSpecificId client_id) {
105 if (!window) 105 if (!window)
106 client_id = kInvalidClientId; 106 client_id = kInvalidClientId;
107 107
108 if (window == capture_window_ && client_id == capture_window_client_id_) 108 if (window == capture_window_ && client_id == capture_window_client_id_)
109 return true; 109 return true;
110 110
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 if (mouse_cursor_source_window_ == window) 652 if (mouse_cursor_source_window_ == window)
653 SetMouseCursorSourceWindow(nullptr); 653 SetMouseCursorSourceWindow(nullptr);
654 } 654 }
655 655
656 void EventDispatcher::OnDragCursorUpdated() { 656 void EventDispatcher::OnDragCursorUpdated() {
657 delegate_->UpdateNativeCursorFromDispatcher(); 657 delegate_->UpdateNativeCursorFromDispatcher();
658 } 658 }
659 659
660 } // namespace ws 660 } // namespace ws
661 } // namespace ui 661 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/drag_controller_unittest.cc ('k') | services/ui/ws/platform_display_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698