Chromium Code Reviews| Index: remoting/host/chromeos/mouse_cursor_monitor_aura.cc |
| diff --git a/remoting/host/chromeos/mouse_cursor_monitor_aura.cc b/remoting/host/chromeos/mouse_cursor_monitor_aura.cc |
| index ad48f141bc0cc040193096016d546607ba7618c3..ebb27254c6e691e5b7f5ebd42601593ca604b00d 100644 |
| --- a/remoting/host/chromeos/mouse_cursor_monitor_aura.cc |
| +++ b/remoting/host/chromeos/mouse_cursor_monitor_aura.cc |
| @@ -36,6 +36,7 @@ void MouseCursorMonitorAura::Capture() { |
| ash::Shell::GetPrimaryRootWindow()->GetHost()->last_cursor(); |
| if (cursor != last_cursor_) { |
| + last_cursor_ = cursor; |
| NotifyCursorChanged(cursor); |
| } |
| @@ -50,17 +51,32 @@ void MouseCursorMonitorAura::Capture() { |
| } |
| } |
| +namespace { |
|
Sergey Ulanov
2015/01/06 18:52:10
nit: move this before MouseCursorMonitorAura const
kelvinp
2015/01/06 22:04:14
Done.
|
| + |
| +webrtc::MouseCursor* CreateEmptyMouseCursor() { |
|
Sergey Ulanov
2015/01/06 18:52:10
Use scoped_ptr<> for the result or add a comment t
Wez
2015/01/06 23:24:25
Not for this CL: Let's add a CreateEmpty() creator
|
| + return new webrtc::MouseCursor( |
| + new webrtc::BasicDesktopFrame(webrtc::DesktopSize(0, 0)), |
| + webrtc::DesktopVector(0, 0)); |
| +} |
| + |
| +} // namespace |
| + |
| void MouseCursorMonitorAura::NotifyCursorChanged(const ui::Cursor& cursor) { |
| scoped_ptr<SkBitmap> cursor_bitmap(new SkBitmap()); |
| gfx::Point cursor_hotspot; |
| + |
| + if (cursor.native_type() == ui::kCursorNone) { |
| + callback_->OnMouseCursor(CreateEmptyMouseCursor()); |
| + return; |
| + } |
| + |
| if (!ui::GetCursorBitmap(cursor, cursor_bitmap.get(), &cursor_hotspot)) { |
| LOG(ERROR) << "Failed to load bitmap for cursor type:" |
| << cursor.native_type(); |
| + callback_->OnMouseCursor(CreateEmptyMouseCursor()); |
| return; |
| } |
| - last_cursor_ = cursor; |
| - |
| // There is a bug (crbug.com/436993) in aura::GetCursorBitmap() such that it |
| // it would return a scale-factor-100 bitmap with a scale-factor-200 hotspot. |
| // This causes the hotspot to go out of range. As a result, we would need to |