Pass the scroll offset to CefRenderHandler::OnScrollOffsetChanged (issue #1561).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2052 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2015-03-06 17:50:14 +00:00
parent a4c4246897
commit 36fd5e3ed0
6 changed files with 21 additions and 9 deletions

View File

@ -159,7 +159,8 @@ typedef struct _cef_render_handler_t {
// Called when the scroll offset has changed.
///
void (CEF_CALLBACK *on_scroll_offset_changed)(
struct _cef_render_handler_t* self, struct _cef_browser_t* browser);
struct _cef_render_handler_t* self, struct _cef_browser_t* browser,
double x, double y);
} cef_render_handler_t;

View File

@ -172,7 +172,9 @@ class CefRenderHandler : public virtual CefBase {
// Called when the scroll offset has changed.
///
/*--cef()--*/
virtual void OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser) {}
virtual void OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser,
double x,
double y) {}
};
#endif // CEF_INCLUDE_CEF_RENDER_HANDLER_H_

View File

@ -1366,8 +1366,11 @@ void CefRenderWidgetHostViewOSR::OnScrollOffsetChanged() {
if (browser_impl_.get()) {
CefRefPtr<CefRenderHandler> handler =
browser_impl_->client()->GetRenderHandler();
if (handler.get())
handler->OnScrollOffsetChanged(browser_impl_.get());
if (handler.get()) {
handler->OnScrollOffsetChanged(browser_impl_.get(),
last_scroll_offset_.x(),
last_scroll_offset_.y());
}
}
is_scroll_offset_changed_pending_ = false;
}

View File

@ -328,7 +328,8 @@ void CEF_CALLBACK render_handler_update_drag_cursor(
}
void CEF_CALLBACK render_handler_on_scroll_offset_changed(
struct _cef_render_handler_t* self, cef_browser_t* browser) {
struct _cef_render_handler_t* self, cef_browser_t* browser, double x,
double y) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@ -341,7 +342,9 @@ void CEF_CALLBACK render_handler_on_scroll_offset_changed(
// Execute
CefRenderHandlerCppToC::Get(self)->OnScrollOffsetChanged(
CefBrowserCToCpp::Wrap(browser));
CefBrowserCToCpp::Wrap(browser),
x,
y);
}

View File

@ -254,7 +254,7 @@ void CefRenderHandlerCToCpp::UpdateDragCursor(CefRefPtr<CefBrowser> browser,
}
void CefRenderHandlerCToCpp::OnScrollOffsetChanged(
CefRefPtr<CefBrowser> browser) {
CefRefPtr<CefBrowser> browser, double x, double y) {
if (CEF_MEMBER_MISSING(struct_, on_scroll_offset_changed))
return;
@ -267,7 +267,9 @@ void CefRenderHandlerCToCpp::OnScrollOffsetChanged(
// Execute
struct_->on_scroll_offset_changed(struct_,
CefBrowserCppToC::Wrap(browser));
CefBrowserCppToC::Wrap(browser),
x,
y);
}

View File

@ -51,7 +51,8 @@ class CefRenderHandlerCToCpp
int y) override;
void UpdateDragCursor(CefRefPtr<CefBrowser> browser,
DragOperation operation) override;
void OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser) override;
void OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser, double x,
double y) override;
};
#endif // BUILDING_CEF_SHARED