Renamed some cursor types to their CSS names and added a way to handle custom cursors properly.

This commit is contained in:
Heilig Benedek 2016-01-31 17:00:14 +01:00
parent 61e0219e91
commit 066c189249
4 changed files with 53 additions and 45 deletions

View file

@ -1043,7 +1043,16 @@ void WebContents::EndFrameSubscription() {
}
void WebContents::OnCursorChange(const content::WebCursor& cursor) {
Emit("cursor-changed", CursorTypeToString(cursor));
content::WebCursor::CursorInfo* info = new content::WebCursor::CursorInfo();
cursor.GetCursorInfo(info);
if (cursor.IsCustom()) {
Emit("cursor-changed", CursorTypeToString(info),
gfx::Image::CreateFrom1xBitmap(info->custom_image),
info->image_scale_factor);
} else {
Emit("cursor-changed", CursorTypeToString(info));
}
}
void WebContents::SetSize(const SetSizeParams& params) {