mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-02 20:26:59 +01:00
Add CefDisplayHandler::OnContentsSizeChange() notificiation (issue #341).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@330 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
04c948fd51
commit
2085cc9ce2
@ -1264,6 +1264,15 @@ public:
|
||||
CefRefPtr<CefFrame> frame,
|
||||
const CefString& url) {}
|
||||
|
||||
///
|
||||
// Called when the size of the content area has changed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnContentsSizeChange(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int width,
|
||||
int height) {}
|
||||
|
||||
///
|
||||
// Called when the page title changes.
|
||||
///
|
||||
|
@ -1076,6 +1076,13 @@ typedef struct _cef_display_handler_t
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Called when the size of the content area has changed.
|
||||
///
|
||||
void (CEF_CALLBACK *on_contents_size_change)(
|
||||
struct _cef_display_handler_t* self, struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, int width, int height);
|
||||
|
||||
///
|
||||
// Called when the page title changes.
|
||||
///
|
||||
|
@ -950,11 +950,23 @@ void BrowserWebViewDelegate::willSendRequest(
|
||||
request.setRequestorID(browser_->UIT_GetUniqueID());
|
||||
}
|
||||
|
||||
void BrowserWebViewDelegate::didChangeContentsSize(
|
||||
WebFrame* frame, const WebSize& size) {
|
||||
CefRefPtr<CefClient> client = browser_->GetClient();
|
||||
if (client.get()) {
|
||||
CefRefPtr<CefDisplayHandler> handler = client->GetDisplayHandler();
|
||||
if (handler.get()) {
|
||||
handler->OnContentsSizeChange(browser_, browser_->UIT_GetCefFrame(frame),
|
||||
size.width, size.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BrowserWebViewDelegate::reportFindInPageMatchCount(
|
||||
int request_id, int count, bool final_update)
|
||||
{
|
||||
browser_->UIT_NotifyFindStatus(request_id, count, gfx::Rect(),
|
||||
-1, // // Don't update active match ordinal.
|
||||
-1, // Don't update active match ordinal.
|
||||
final_update);
|
||||
}
|
||||
|
||||
|
@ -180,6 +180,8 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient,
|
||||
virtual void willSendRequest(
|
||||
WebKit::WebFrame*, unsigned identifier, WebKit::WebURLRequest&,
|
||||
const WebKit::WebURLResponse& redirectResponse) OVERRIDE;
|
||||
virtual void didChangeContentsSize(
|
||||
WebKit::WebFrame*, const WebKit::WebSize&) OVERRIDE;
|
||||
virtual void reportFindInPageMatchCount(
|
||||
int request_id, int count, bool final_update) OVERRIDE;
|
||||
virtual void reportFindInPageSelection(
|
||||
|
@ -47,6 +47,21 @@ void CEF_CALLBACK display_handler_on_address_change(
|
||||
CefString(url));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK display_handler_on_contents_size_change(
|
||||
struct _cef_display_handler_t* self, cef_browser_t* browser,
|
||||
cef_frame_t* frame, int width, int height)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(browser);
|
||||
DCHECK(frame);
|
||||
if (!self || !browser || !frame)
|
||||
return;
|
||||
|
||||
CefDisplayHandlerCppToC::Get(self)->OnContentsSizeChange(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), width,
|
||||
height);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK display_handler_on_title_change(
|
||||
struct _cef_display_handler_t* self, cef_browser_t* browser,
|
||||
const cef_string_t* title)
|
||||
@ -109,6 +124,8 @@ CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls)
|
||||
{
|
||||
struct_.struct_.on_nav_state_change = display_handler_on_nav_state_change;
|
||||
struct_.struct_.on_address_change = display_handler_on_address_change;
|
||||
struct_.struct_.on_contents_size_change =
|
||||
display_handler_on_contents_size_change;
|
||||
struct_.struct_.on_title_change = display_handler_on_title_change;
|
||||
struct_.struct_.on_tooltip = display_handler_on_tooltip;
|
||||
struct_.struct_.on_status_message = display_handler_on_status_message;
|
||||
|
@ -37,6 +37,17 @@ void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr<CefBrowser> browser,
|
||||
CefFrameCppToC::Wrap(frame), url.GetStruct());
|
||||
}
|
||||
|
||||
void CefDisplayHandlerCToCpp::OnContentsSizeChange(
|
||||
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int width,
|
||||
int height)
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, on_contents_size_change))
|
||||
return;
|
||||
|
||||
struct_->on_contents_size_change(struct_, CefBrowserCppToC::Wrap(browser),
|
||||
CefFrameCppToC::Wrap(frame), width, height);
|
||||
}
|
||||
|
||||
void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& title)
|
||||
{
|
||||
|
@ -37,6 +37,8 @@ public:
|
||||
bool canGoForward) OVERRIDE;
|
||||
virtual void OnAddressChange(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame, const CefString& url) OVERRIDE;
|
||||
virtual void OnContentsSizeChange(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame, int width, int height) OVERRIDE;
|
||||
virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& title) OVERRIDE;
|
||||
virtual bool OnTooltip(CefRefPtr<CefBrowser> browser,
|
||||
|
Loading…
x
Reference in New Issue
Block a user