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 "remoting/host/chromeos/mouse_cursor_monitor_aura.h" | 5 #include "remoting/host/chromeos/mouse_cursor_monitor_aura.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 cursor_hotspot.y() / scale_factor); | 88 cursor_hotspot.y() / scale_factor); |
89 | 89 |
90 if (cursor_hotspot.x() >= cursor_bitmap->width() || | 90 if (cursor_hotspot.x() >= cursor_bitmap->width() || |
91 cursor_hotspot.y() >= cursor_bitmap->height()) { | 91 cursor_hotspot.y() >= cursor_bitmap->height()) { |
92 LOG(WARNING) << "Cursor hotspot is out of bounds for type: " | 92 LOG(WARNING) << "Cursor hotspot is out of bounds for type: " |
93 << cursor.native_type() << ". Setting to (0,0) instead"; | 93 << cursor.native_type() << ". Setting to (0,0) instead"; |
94 cursor_hotspot.SetPoint(0, 0); | 94 cursor_hotspot.SetPoint(0, 0); |
95 } | 95 } |
96 | 96 |
97 scoped_ptr<webrtc::DesktopFrame> image( | 97 scoped_ptr<webrtc::DesktopFrame> image( |
98 SkiaBitmapDesktopFrame::Create(cursor_bitmap.Pass())); | 98 SkiaBitmapDesktopFrame::Create(std::move(cursor_bitmap))); |
99 scoped_ptr<webrtc::MouseCursor> cursor_shape(new webrtc::MouseCursor( | 99 scoped_ptr<webrtc::MouseCursor> cursor_shape(new webrtc::MouseCursor( |
100 image.release(), | 100 image.release(), |
101 webrtc::DesktopVector(cursor_hotspot.x(), cursor_hotspot.y()))); | 101 webrtc::DesktopVector(cursor_hotspot.x(), cursor_hotspot.y()))); |
102 | 102 |
103 callback_->OnMouseCursor(cursor_shape.release()); | 103 callback_->OnMouseCursor(cursor_shape.release()); |
104 } | 104 } |
105 | 105 |
106 } // namespace remoting | 106 } // namespace remoting |
OLD | NEW |