| 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..f1120aa2b5ed663c912fd2f7d6fe916e13925669 100644
|
| --- a/remoting/host/chromeos/mouse_cursor_monitor_aura.cc
|
| +++ b/remoting/host/chromeos/mouse_cursor_monitor_aura.cc
|
| @@ -15,6 +15,18 @@
|
| #include "ui/aura/window_tree_host.h"
|
| #include "ui/base/cursor/cursors_aura.h"
|
|
|
| +namespace {
|
| +
|
| +// Creates an empty webrtc::MouseCursor. The caller is responsible for
|
| +// destroying the returned cursor.
|
| +webrtc::MouseCursor* CreateEmptyMouseCursor() {
|
| + return new webrtc::MouseCursor(
|
| + new webrtc::BasicDesktopFrame(webrtc::DesktopSize(0, 0)),
|
| + webrtc::DesktopVector(0, 0));
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| namespace remoting {
|
|
|
| MouseCursorMonitorAura::MouseCursorMonitorAura()
|
| @@ -36,6 +48,7 @@ void MouseCursorMonitorAura::Capture() {
|
| ash::Shell::GetPrimaryRootWindow()->GetHost()->last_cursor();
|
|
|
| if (cursor != last_cursor_) {
|
| + last_cursor_ = cursor;
|
| NotifyCursorChanged(cursor);
|
| }
|
|
|
| @@ -53,14 +66,19 @@ void MouseCursorMonitorAura::Capture() {
|
| 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
|
|
|