| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |