}
void WebContents::OnCursorChange(const content::WebCursor& cursor) {
- content::WebCursor::CursorInfo* info = new content::WebCursor::CursorInfo();
- cursor.GetCursorInfo(info);
+ content::WebCursor::CursorInfo info;
+ cursor.GetCursorInfo(&info);
if (cursor.IsCustom()) {
Emit("cursor-changed", CursorTypeToString(info),
- gfx::Image::CreateFrom1xBitmap(info->custom_image),
- info->image_scale_factor);
+ gfx::Image::CreateFrom1xBitmap(info.custom_image),
+ info.image_scale_factor);
} else {
Emit("cursor-changed", CursorTypeToString(info));
}
namespace atom {
-std::string CursorTypeToString(const content::WebCursor::CursorInfo* info) {
- switch (info->type) {
+std::string CursorTypeToString(const content::WebCursor::CursorInfo& info) {
+ switch (info.type) {
case Cursor::TypePointer: return "default";
case Cursor::TypeCross: return "crosshair";
case Cursor::TypeHand: return "pointer";
namespace atom {
// Returns the cursor's type as a string.
-std::string CursorTypeToString(const content::WebCursor::CursorInfo* info);
+std::string CursorTypeToString(const content::WebCursor::CursorInfo& info);
} // namespace atom
* `event` Event
* `type` String
-* `image` NativeImage
-* `scale` Float
+* `image` NativeImage (optional)
+* `scale` Float (optional)
Emitted when the cursor's type changes. The `type` parameter can be `default`,
`crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,