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

Side by Side Diff: services/ui/ws/platform_display.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/platform_display.h ('k') | services/ui/ws/server_window.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/platform_display.h" 5 #include "services/ui/ws/platform_display.h"
6 6
7 #include "base/numerics/safe_conversions.h" 7 #include "base/numerics/safe_conversions.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "cc/ipc/quads.mojom.h" 9 #include "cc/ipc/quads.mojom.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 void DefaultPlatformDisplay::SetCapture() { 127 void DefaultPlatformDisplay::SetCapture() {
128 platform_window_->SetCapture(); 128 platform_window_->SetCapture();
129 } 129 }
130 130
131 void DefaultPlatformDisplay::ReleaseCapture() { 131 void DefaultPlatformDisplay::ReleaseCapture() {
132 platform_window_->ReleaseCapture(); 132 platform_window_->ReleaseCapture();
133 } 133 }
134 134
135 void DefaultPlatformDisplay::SetCursorById(int32_t cursor_id) { 135 void DefaultPlatformDisplay::SetCursorById(mojom::Cursor cursor_id) {
136 #if !defined(OS_ANDROID) 136 #if !defined(OS_ANDROID)
137 // TODO(erg): This still isn't sufficient, and will only use native cursors 137 // TODO(erg): This still isn't sufficient, and will only use native cursors
138 // that chrome would use, not custom image cursors. For that, we should 138 // that chrome would use, not custom image cursors. For that, we should
139 // delegate to the window manager to load images from resource packs. 139 // delegate to the window manager to load images from resource packs.
140 // 140 //
141 // We probably also need to deal with different DPIs. 141 // We probably also need to deal with different DPIs.
142 ui::Cursor cursor(cursor_id); 142 ui::Cursor cursor(static_cast<int32_t>(cursor_id));
143 cursor_loader_->SetPlatformCursor(&cursor); 143 cursor_loader_->SetPlatformCursor(&cursor);
144 platform_window_->SetCursor(cursor.platform()); 144 platform_window_->SetCursor(cursor.platform());
145 #endif 145 #endif
146 } 146 }
147 147
148 float DefaultPlatformDisplay::GetDeviceScaleFactor() { 148 float DefaultPlatformDisplay::GetDeviceScaleFactor() {
149 return metrics_.device_scale_factor; 149 return metrics_.device_scale_factor;
150 } 150 }
151 151
152 display::Display::Rotation DefaultPlatformDisplay::GetRotation() { 152 display::Display::Rotation DefaultPlatformDisplay::GetRotation() {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 return delegate_ ? delegate_->IsInHighContrastMode() : false; 306 return delegate_ ? delegate_->IsInHighContrastMode() : false;
307 } 307 }
308 308
309 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() { 309 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() {
310 return metrics_; 310 return metrics_;
311 } 311 }
312 312
313 } // namespace ws 313 } // namespace ws
314 314
315 } // namespace ui 315 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/platform_display.h ('k') | services/ui/ws/server_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698