webContents: override fullscreen notification apis for webview

This commit is contained in:
deepak1556 2015-05-08 11:48:15 +05:30
parent 71ee864d1d
commit be57151037
2 changed files with 25 additions and 0 deletions

View file

@ -215,6 +215,26 @@ void WebContents::HandleKeyboardEvent(
web_contents(), event);
}
void WebContents::EnterFullscreenModeForTab(content::WebContents* web_contents,
const GURL& origin) {
GetWindowFromGuest(web_contents)->SetFullScreen(true);
web_contents->GetRenderViewHost()->WasResized();
}
void WebContents::ExitFullscreenModeForTab(content::WebContents* web_contents) {
GetWindowFromGuest(web_contents)->SetFullScreen(false);
web_contents->GetRenderViewHost()->WasResized();
}
bool WebContents::IsFullscreenForTabOrPending(
const content::WebContents* web_contents) const {
auto window = GetWindowFromGuest(web_contents);
if (window)
return window->IsFullscreen();
else
return false;
}
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
Emit("render-view-deleted",
render_view_host->GetProcess()->GetID(),

View file

@ -151,6 +151,11 @@ class WebContents : public mate::EventEmitter,
void HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
void EnterFullscreenModeForTab(content::WebContents* web_contents,
const GURL& origin) override;
void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
bool IsFullscreenForTabOrPending(
const content::WebContents* web_contents) const override;
// content::WebContentsObserver:
void RenderViewDeleted(content::RenderViewHost*) override;