Add CefBrowserHost::WasHidden() method for notifying a windowless browser that it has been hidden or shown (issue #909).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1180 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-04-05 17:37:40 +00:00
parent ba2fa28c05
commit 67d59cb2b9
7 changed files with 69 additions and 0 deletions

View File

@ -641,6 +641,32 @@ void CefBrowserHostImpl::WasResized() {
widget->WasResized();
}
void CefBrowserHostImpl::WasHidden(bool hidden) {
if (!IsWindowRenderingDisabled()) {
NOTREACHED() << "Window rendering is not disabled";
return;
}
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::WasHidden, this, hidden));
return;
}
if (!web_contents())
return;
content::RenderWidgetHostImpl* widget =
content::RenderWidgetHostImpl::From(web_contents()->GetRenderViewHost());
if (!widget)
return;
if (hidden)
widget->WasHidden();
else
widget->WasShown();
}
void CefBrowserHostImpl::Invalidate(const CefRect& dirtyRect,
PaintElementType type) {
if (!IsWindowRenderingDisabled()) {
@ -848,6 +874,7 @@ void CefBrowserHostImpl::SendFocusEvent(bool setFocus) {
widget->Blur();
}
}
void CefBrowserHostImpl::SendCaptureLostEvent() {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,