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

Side by Side Diff: services/ui/ws/event_dispatcher.cc

Issue 2378883002: mus ws: Consistently use mojom::Cursor instead of int32_t. (Closed)
Patch Set: Created 4 years, 2 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/event_dispatcher.h ('k') | services/ui/ws/platform_display.h » ('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/time/time.h" 9 #include "base/time/time.h"
10 #include "services/ui/ws/accelerator.h" 10 #include "services/ui/ws/accelerator.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 const gfx::Point& screen_location) { 96 const gfx::Point& screen_location) {
97 DCHECK(pointer_targets_.empty()); 97 DCHECK(pointer_targets_.empty());
98 mouse_pointer_last_location_ = screen_location; 98 mouse_pointer_last_location_ = screen_location;
99 UpdateCursorProviderByLastKnownLocation(); 99 UpdateCursorProviderByLastKnownLocation();
100 // Write our initial location back to our shared screen coordinate. This 100 // Write our initial location back to our shared screen coordinate. This
101 // shouldn't cause problems because we already read the cursor before we 101 // shouldn't cause problems because we already read the cursor before we
102 // process any events in views during window construction. 102 // process any events in views during window construction.
103 delegate_->OnMouseCursorLocationChanged(screen_location); 103 delegate_->OnMouseCursorLocationChanged(screen_location);
104 } 104 }
105 105
106 bool EventDispatcher::GetCurrentMouseCursor(int32_t* cursor_out) { 106 bool EventDispatcher::GetCurrentMouseCursor(ui::mojom::Cursor* cursor_out) {
107 if (drag_controller_) { 107 if (drag_controller_) {
108 *cursor_out = drag_controller_->current_cursor(); 108 *cursor_out = drag_controller_->current_cursor();
109 return true; 109 return true;
110 } 110 }
111 111
112 if (!mouse_cursor_source_window_) 112 if (!mouse_cursor_source_window_)
113 return false; 113 return false;
114 114
115 *cursor_out = mouse_cursor_in_non_client_area_ 115 *cursor_out = mouse_cursor_in_non_client_area_
116 ? mouse_cursor_source_window_->non_client_cursor() 116 ? mouse_cursor_source_window_->non_client_cursor()
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 if (mouse_cursor_source_window_ == window) 616 if (mouse_cursor_source_window_ == window)
617 mouse_cursor_source_window_ = nullptr; 617 mouse_cursor_source_window_ = nullptr;
618 } 618 }
619 619
620 void EventDispatcher::OnDragCursorUpdated() { 620 void EventDispatcher::OnDragCursorUpdated() {
621 delegate_->UpdateNativeCursorFromDispatcher(); 621 delegate_->UpdateNativeCursorFromDispatcher();
622 } 622 }
623 623
624 } // namespace ws 624 } // namespace ws
625 } // namespace ui 625 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/event_dispatcher.h ('k') | services/ui/ws/platform_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698