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

Unified Diff: remoting/host/chromeos/mouse_cursor_monitor_aura.cc

Issue 833693002: Hide the cursor on the client when it is hidden on the host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hides the cursor properly on the client Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/video_scheduler.cc » ('j') | remoting/host/video_scheduler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | remoting/host/video_scheduler.cc » ('j') | remoting/host/video_scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698