Pass cursor type and custom cursor information to CefRenderHandler::OnCursorChange (issue #1443).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1928 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
8eb14dd71f
commit
93c1a7fcd7
|
@ -109,8 +109,8 @@ typedef struct _cef_render_handler_t {
|
||||||
// Called when an element should be painted. |type| indicates whether the
|
// Called when an element should be painted. |type| indicates whether the
|
||||||
// element is the view or the popup widget. |buffer| contains the pixel data
|
// element is the view or the popup widget. |buffer| contains the pixel data
|
||||||
// for the whole image. |dirtyRects| contains the set of rectangles that need
|
// for the whole image. |dirtyRects| contains the set of rectangles that need
|
||||||
// to be repainted. On Windows |buffer| will be |width|*|height|*4 bytes in
|
// to be repainted. |buffer| will be |width|*|height|*4 bytes in size and
|
||||||
// size and represents a BGRA image with an upper-left origin.
|
// represents a BGRA image with an upper-left origin.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
|
void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_paint_element_type_t type,
|
struct _cef_browser_t* browser, cef_paint_element_type_t type,
|
||||||
|
@ -118,10 +118,13 @@ typedef struct _cef_render_handler_t {
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser window's cursor has changed.
|
// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
|
||||||
|
// |custom_cursor_info| will be populated with the custom cursor information.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
|
void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_cursor_handle_t cursor);
|
struct _cef_browser_t* browser, cef_cursor_handle_t cursor,
|
||||||
|
cef_cursor_type_t type,
|
||||||
|
const struct _cef_cursor_info_t* custom_cursor_info);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the user starts dragging content in the web view. Contextual
|
// Called when the user starts dragging content in the web view. Contextual
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
/*--cef(source=client)--*/
|
/*--cef(source=client)--*/
|
||||||
class CefRenderHandler : public virtual CefBase {
|
class CefRenderHandler : public virtual CefBase {
|
||||||
public:
|
public:
|
||||||
|
typedef cef_cursor_type_t CursorType;
|
||||||
typedef cef_drag_operations_mask_t DragOperation;
|
typedef cef_drag_operations_mask_t DragOperation;
|
||||||
typedef cef_drag_operations_mask_t DragOperationsMask;
|
typedef cef_drag_operations_mask_t DragOperationsMask;
|
||||||
typedef cef_paint_element_type_t PaintElementType;
|
typedef cef_paint_element_type_t PaintElementType;
|
||||||
|
@ -114,8 +115,8 @@ class CefRenderHandler : public virtual CefBase {
|
||||||
// Called when an element should be painted. |type| indicates whether the
|
// Called when an element should be painted. |type| indicates whether the
|
||||||
// element is the view or the popup widget. |buffer| contains the pixel data
|
// element is the view or the popup widget. |buffer| contains the pixel data
|
||||||
// for the whole image. |dirtyRects| contains the set of rectangles that need
|
// for the whole image. |dirtyRects| contains the set of rectangles that need
|
||||||
// to be repainted. On Windows |buffer| will be |width|*|height|*4 bytes
|
// to be repainted. |buffer| will be |width|*|height|*4 bytes in size and
|
||||||
// in size and represents a BGRA image with an upper-left origin.
|
// represents a BGRA image with an upper-left origin.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual void OnPaint(CefRefPtr<CefBrowser> browser,
|
virtual void OnPaint(CefRefPtr<CefBrowser> browser,
|
||||||
|
@ -125,11 +126,14 @@ class CefRenderHandler : public virtual CefBase {
|
||||||
int width, int height) =0;
|
int width, int height) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the browser window's cursor has changed.
|
// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
|
||||||
|
// |custom_cursor_info| will be populated with the custom cursor information.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) {}
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) {}
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called when the user starts dragging content in the web view. Contextual
|
// Called when the user starts dragging content in the web view. Contextual
|
||||||
|
|
|
@ -1840,6 +1840,68 @@ typedef struct _cef_page_range_t {
|
||||||
int to;
|
int to;
|
||||||
} cef_page_range_t;
|
} cef_page_range_t;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Cursor type values.
|
||||||
|
///
|
||||||
|
typedef enum {
|
||||||
|
CT_POINTER = 0,
|
||||||
|
CT_CROSS,
|
||||||
|
CT_HAND,
|
||||||
|
CT_IBEAM,
|
||||||
|
CT_WAIT,
|
||||||
|
CT_HELP,
|
||||||
|
CT_EASTRESIZE,
|
||||||
|
CT_NORTHRESIZE,
|
||||||
|
CT_NORTHEASTRESIZE,
|
||||||
|
CT_NORTHWESTRESIZE,
|
||||||
|
CT_SOUTHRESIZE,
|
||||||
|
CT_SOUTHEASTRESIZE,
|
||||||
|
CT_SOUTHWESTRESIZE,
|
||||||
|
CT_WESTRESIZE,
|
||||||
|
CT_NORTHSOUTHRESIZE,
|
||||||
|
CT_EASTWESTRESIZE,
|
||||||
|
CT_NORTHEASTSOUTHWESTRESIZE,
|
||||||
|
CT_NORTHWESTSOUTHEASTRESIZE,
|
||||||
|
CT_COLUMNRESIZE,
|
||||||
|
CT_ROWRESIZE,
|
||||||
|
CT_MIDDLEPANNING,
|
||||||
|
CT_EASTPANNING,
|
||||||
|
CT_NORTHPANNING,
|
||||||
|
CT_NORTHEASTPANNING,
|
||||||
|
CT_NORTHWESTPANNING,
|
||||||
|
CT_SOUTHPANNING,
|
||||||
|
CT_SOUTHEASTPANNING,
|
||||||
|
CT_SOUTHWESTPANNING,
|
||||||
|
CT_WESTPANNING,
|
||||||
|
CT_MOVE,
|
||||||
|
CT_VERTICALTEXT,
|
||||||
|
CT_CELL,
|
||||||
|
CT_CONTEXTMENU,
|
||||||
|
CT_ALIAS,
|
||||||
|
CT_PROGRESS,
|
||||||
|
CT_NODROP,
|
||||||
|
CT_COPY,
|
||||||
|
CT_NONE,
|
||||||
|
CT_NOTALLOWED,
|
||||||
|
CT_ZOOMIN,
|
||||||
|
CT_ZOOMOUT,
|
||||||
|
CT_GRAB,
|
||||||
|
CT_GRABBING,
|
||||||
|
CT_CUSTOM,
|
||||||
|
} cef_cursor_type_t;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Structure representing cursor information. |buffer| will be
|
||||||
|
// |size.width|*|size.height|*4 bytes in size and represents a BGRA image with
|
||||||
|
// an upper-left origin.
|
||||||
|
///
|
||||||
|
typedef struct _cef_cursor_info_t {
|
||||||
|
cef_point_t hotspot;
|
||||||
|
float image_scale_factor;
|
||||||
|
void* buffer;
|
||||||
|
cef_size_t size;
|
||||||
|
} cef_cursor_info_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -756,4 +756,25 @@ inline bool operator!=(const CefPageRange& a, const CefPageRange& b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct CefCursorInfoTraits {
|
||||||
|
typedef cef_cursor_info_t struct_type;
|
||||||
|
|
||||||
|
static inline void init(struct_type* s) {}
|
||||||
|
|
||||||
|
static inline void clear(struct_type* s) {}
|
||||||
|
|
||||||
|
static inline void set(const struct_type* src, struct_type* target,
|
||||||
|
bool copy) {
|
||||||
|
target->hotspot = src->hotspot;
|
||||||
|
target->image_scale_factor = src->image_scale_factor;
|
||||||
|
target->buffer = src->buffer;
|
||||||
|
target->size = src->size;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Class representing cursor information.
|
||||||
|
///
|
||||||
|
typedef CefStructBase<CefCursorInfoTraits> CefCursorInfo;
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
|
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
|
||||||
|
|
|
@ -368,6 +368,21 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(
|
||||||
if (!browser_impl_.get())
|
if (!browser_impl_.get())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
content::WebCursor::CursorInfo cursor_info;
|
||||||
|
cursor.GetCursorInfo(&cursor_info);
|
||||||
|
|
||||||
|
const cef_cursor_type_t cursor_type =
|
||||||
|
static_cast<cef_cursor_type_t>(cursor_info.type);
|
||||||
|
CefCursorInfo custom_cursor_info;
|
||||||
|
if (cursor.IsCustom()) {
|
||||||
|
custom_cursor_info.hotspot.x = cursor_info.hotspot.x();
|
||||||
|
custom_cursor_info.hotspot.y = cursor_info.hotspot.y();
|
||||||
|
custom_cursor_info.image_scale_factor = cursor_info.image_scale_factor;
|
||||||
|
custom_cursor_info.buffer = cursor_info.custom_image.getPixels();
|
||||||
|
custom_cursor_info.size.width = cursor_info.custom_image.width();
|
||||||
|
custom_cursor_info.size.height = cursor_info.custom_image.height();
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(USE_AURA)
|
#if defined(USE_AURA)
|
||||||
content::WebCursor web_cursor = cursor;
|
content::WebCursor web_cursor = cursor;
|
||||||
|
|
||||||
|
@ -376,19 +391,17 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(
|
||||||
// |web_cursor| owns the resulting |platform_cursor|.
|
// |web_cursor| owns the resulting |platform_cursor|.
|
||||||
platform_cursor = web_cursor.GetPlatformCursor();
|
platform_cursor = web_cursor.GetPlatformCursor();
|
||||||
} else {
|
} else {
|
||||||
content::WebCursor::CursorInfo cursor_info;
|
|
||||||
cursor.GetCursorInfo(&cursor_info);
|
|
||||||
platform_cursor = browser_impl_->GetPlatformCursor(cursor_info.type);
|
platform_cursor = browser_impl_->GetPlatformCursor(cursor_info.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
browser_impl_->GetClient()->GetRenderHandler()->OnCursorChange(
|
browser_impl_->GetClient()->GetRenderHandler()->OnCursorChange(
|
||||||
browser_impl_.get(), platform_cursor);
|
browser_impl_.get(), platform_cursor, cursor_type, custom_cursor_info);
|
||||||
#elif defined(OS_MACOSX)
|
#elif defined(OS_MACOSX)
|
||||||
// |web_cursor| owns the resulting |native_cursor|.
|
// |web_cursor| owns the resulting |native_cursor|.
|
||||||
content::WebCursor web_cursor = cursor;
|
content::WebCursor web_cursor = cursor;
|
||||||
CefCursorHandle native_cursor = web_cursor.GetNativeCursor();
|
CefCursorHandle native_cursor = web_cursor.GetNativeCursor();
|
||||||
browser_impl_->GetClient()->GetRenderHandler()->OnCursorChange(
|
browser_impl_->GetClient()->GetRenderHandler()->OnCursorChange(
|
||||||
browser_impl_.get(), native_cursor);
|
browser_impl_.get(), native_cursor, cursor_type, custom_cursor_info);
|
||||||
#else
|
#else
|
||||||
// TODO(port): Implement this method to work on other platforms as part of
|
// TODO(port): Implement this method to work on other platforms as part of
|
||||||
// off-screen rendering support.
|
// off-screen rendering support.
|
||||||
|
|
|
@ -249,7 +249,8 @@ void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self,
|
||||||
|
|
||||||
void CEF_CALLBACK render_handler_on_cursor_change(
|
void CEF_CALLBACK render_handler_on_cursor_change(
|
||||||
struct _cef_render_handler_t* self, cef_browser_t* browser,
|
struct _cef_render_handler_t* self, cef_browser_t* browser,
|
||||||
cef_cursor_handle_t cursor) {
|
cef_cursor_handle_t cursor, cef_cursor_type_t type,
|
||||||
|
const struct _cef_cursor_info_t* custom_cursor_info) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
|
@ -259,11 +260,22 @@ void CEF_CALLBACK render_handler_on_cursor_change(
|
||||||
DCHECK(browser);
|
DCHECK(browser);
|
||||||
if (!browser)
|
if (!browser)
|
||||||
return;
|
return;
|
||||||
|
// Verify param: custom_cursor_info; type: struct_byref_const
|
||||||
|
DCHECK(custom_cursor_info);
|
||||||
|
if (!custom_cursor_info)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Translate param: custom_cursor_info; type: struct_byref_const
|
||||||
|
CefCursorInfo custom_cursor_infoObj;
|
||||||
|
if (custom_cursor_info)
|
||||||
|
custom_cursor_infoObj.Set(*custom_cursor_info, false);
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRenderHandlerCppToC::Get(self)->OnCursorChange(
|
CefRenderHandlerCppToC::Get(self)->OnCursorChange(
|
||||||
CefBrowserCToCpp::Wrap(browser),
|
CefBrowserCToCpp::Wrap(browser),
|
||||||
cursor);
|
cursor,
|
||||||
|
type,
|
||||||
|
custom_cursor_infoObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK render_handler_start_dragging(
|
int CEF_CALLBACK render_handler_start_dragging(
|
||||||
|
|
|
@ -186,7 +186,8 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) {
|
CefCursorHandle cursor, CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) {
|
||||||
if (CEF_MEMBER_MISSING(struct_, on_cursor_change))
|
if (CEF_MEMBER_MISSING(struct_, on_cursor_change))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -200,7 +201,9 @@ void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
// Execute
|
// Execute
|
||||||
struct_->on_cursor_change(struct_,
|
struct_->on_cursor_change(struct_,
|
||||||
CefBrowserCppToC::Wrap(browser),
|
CefBrowserCppToC::Wrap(browser),
|
||||||
cursor);
|
cursor,
|
||||||
|
type,
|
||||||
|
&custom_cursor_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefRenderHandlerCToCpp::StartDragging(CefRefPtr<CefBrowser> browser,
|
bool CefRenderHandlerCToCpp::StartDragging(CefRefPtr<CefBrowser> browser,
|
||||||
|
|
|
@ -44,8 +44,8 @@ class CefRenderHandlerCToCpp
|
||||||
void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type,
|
void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type,
|
||||||
const RectList& dirtyRects, const void* buffer, int width,
|
const RectList& dirtyRects, const void* buffer, int width,
|
||||||
int height) override;
|
int height) override;
|
||||||
void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
void OnCursorChange(CefRefPtr<CefBrowser> browser, CefCursorHandle cursor,
|
||||||
CefCursorHandle cursor) override;
|
CursorType type, const CefCursorInfo& custom_cursor_info) override;
|
||||||
bool StartDragging(CefRefPtr<CefBrowser> browser,
|
bool StartDragging(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefDragData> drag_data, DragOperationsMask allowed_ops, int x,
|
CefRefPtr<CefDragData> drag_data, DragOperationsMask allowed_ops, int x,
|
||||||
int y) override;
|
int y) override;
|
||||||
|
|
|
@ -1184,13 +1184,9 @@ void OSRWindow::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSRWindow::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
void OSRWindow::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) {
|
CefCursorHandle cursor,
|
||||||
/*GtkWidget* window = gtk_widget_get_toplevel(glarea_);
|
CursorType type,
|
||||||
GdkWindow* gdk_window = gtk_widget_get_window(window);
|
const CefCursorInfo& custom_cursor_info) {
|
||||||
if (cursor->type == GDK_LAST_CURSOR)
|
|
||||||
cursor = NULL;
|
|
||||||
gdk_window_set_cursor(gdk_window, cursor);*/
|
|
||||||
|
|
||||||
// Retrieve the X11 display shared with Chromium.
|
// Retrieve the X11 display shared with Chromium.
|
||||||
::Display* xdisplay = cef_get_xdisplay();
|
::Display* xdisplay = cef_get_xdisplay();
|
||||||
DCHECK(xdisplay);
|
DCHECK(xdisplay);
|
||||||
|
|
|
@ -60,7 +60,9 @@ class OSRWindow : public ClientHandler::RenderHandler {
|
||||||
int width,
|
int width,
|
||||||
int height) OVERRIDE;
|
int height) OVERRIDE;
|
||||||
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) OVERRIDE;
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) OVERRIDE;
|
||||||
|
|
||||||
void Invalidate();
|
void Invalidate();
|
||||||
bool IsOverPopupWidget(int x, int y) const;
|
bool IsOverPopupWidget(int x, int y) const;
|
||||||
|
|
|
@ -92,7 +92,9 @@ class ClientOSRHandler : public ClientHandler::RenderHandler {
|
||||||
int width, int height) OVERRIDE;
|
int width, int height) OVERRIDE;
|
||||||
|
|
||||||
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) OVERRIDE;
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) OVERRIDE;
|
||||||
|
|
||||||
virtual bool StartDragging(CefRefPtr<CefBrowser> browser,
|
virtual bool StartDragging(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefDragData> drag_data,
|
CefRefPtr<CefDragData> drag_data,
|
||||||
|
|
|
@ -252,7 +252,9 @@ void ClientOSRHandler::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientOSRHandler::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
void ClientOSRHandler::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) {
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) {
|
||||||
CEF_REQUIRE_UI_THREAD();
|
CEF_REQUIRE_UI_THREAD();
|
||||||
[cursor set];
|
[cursor set];
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,9 @@ void OSRWindow::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSRWindow::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
void OSRWindow::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) {
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) {
|
||||||
if (!::IsWindow(hWnd_))
|
if (!::IsWindow(hWnd_))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,9 @@ class OSRWindow : public ClientHandler::RenderHandler
|
||||||
int width,
|
int width,
|
||||||
int height) OVERRIDE;
|
int height) OVERRIDE;
|
||||||
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) OVERRIDE;
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) OVERRIDE;
|
||||||
virtual bool StartDragging(CefRefPtr<CefBrowser> browser,
|
virtual bool StartDragging(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefDragData> drag_data,
|
CefRefPtr<CefDragData> drag_data,
|
||||||
CefRenderHandler::DragOperationsMask allowed_ops,
|
CefRenderHandler::DragOperationsMask allowed_ops,
|
||||||
|
|
|
@ -649,11 +649,13 @@ void ClientHandler::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandler::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
void ClientHandler::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) {
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) {
|
||||||
CEF_REQUIRE_UI_THREAD();
|
CEF_REQUIRE_UI_THREAD();
|
||||||
if (!osr_handler_.get())
|
if (!osr_handler_.get())
|
||||||
return;
|
return;
|
||||||
osr_handler_->OnCursorChange(browser, cursor);
|
osr_handler_->OnCursorChange(browser, cursor, type, custom_cursor_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClientHandler::StartDragging(CefRefPtr<CefBrowser> browser,
|
bool ClientHandler::StartDragging(CefRefPtr<CefBrowser> browser,
|
||||||
|
|
|
@ -237,7 +237,9 @@ class ClientHandler : public CefClient,
|
||||||
int width,
|
int width,
|
||||||
int height) OVERRIDE;
|
int height) OVERRIDE;
|
||||||
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) OVERRIDE;
|
CefCursorHandle cursor,
|
||||||
|
CursorType type,
|
||||||
|
const CefCursorInfo& custom_cursor_info) OVERRIDE;
|
||||||
virtual bool StartDragging(CefRefPtr<CefBrowser> browser,
|
virtual bool StartDragging(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefDragData> drag_data,
|
CefRefPtr<CefDragData> drag_data,
|
||||||
CefRenderHandler::DragOperationsMask allowed_ops,
|
CefRenderHandler::DragOperationsMask allowed_ops,
|
||||||
|
|
|
@ -783,10 +783,14 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||||
CefCursorHandle cursor) override {
|
CefCursorHandle cursor,
|
||||||
if (test_type_ == OSR_TEST_CURSOR && started()) {
|
CursorType type,
|
||||||
DestroySucceededTestSoon();
|
const CefCursorInfo& custom_cursor_info) override {
|
||||||
}
|
if (test_type_ == OSR_TEST_CURSOR && started()) {
|
||||||
|
EXPECT_EQ(CT_HAND, type);
|
||||||
|
EXPECT_EQ(NULL, custom_cursor_info.buffer);
|
||||||
|
DestroySucceededTestSoon();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartDragging(CefRefPtr<CefBrowser> browser,
|
bool StartDragging(CefRefPtr<CefBrowser> browser,
|
||||||
|
|
Loading…
Reference in New Issue