window: supports HTML5 fullscreen api

This commit is contained in:
deepak1556 2015-04-21 19:05:36 +05:30
parent 67bc4afe88
commit 20b4cae980
6 changed files with 24 additions and 5 deletions

View file

@ -685,6 +685,20 @@ void NativeWindow::RendererResponsive(content::WebContents* source) {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnRendererResponsive());
}
void NativeWindow::EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) {
SetFullScreen(true);
}
void NativeWindow::ExitFullscreenModeForTab(content::WebContents* source) {
SetFullScreen(false);
}
bool NativeWindow::IsFullscreenForTabOrPending(
const content::WebContents* source) const {
return IsFullscreen();
}
void NativeWindow::BeforeUnloadFired(const base::TimeTicks& proceed_time) {
// Do nothing, we override this method just to avoid compilation error since
// there are two virtual functions named BeforeUnloadFired.

View file

@ -112,7 +112,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
virtual void Restore() = 0;
virtual bool IsMinimized() = 0;
virtual void SetFullScreen(bool fullscreen) = 0;
virtual bool IsFullscreen() = 0;
virtual bool IsFullscreen() const = 0;
virtual void SetSize(const gfx::Size& size) = 0;
virtual gfx::Size GetSize() = 0;
virtual void SetContentSize(const gfx::Size& size) = 0;
@ -273,6 +273,11 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
const content::WebContents* source) const override;
void RendererUnresponsive(content::WebContents* source) override;
void RendererResponsive(content::WebContents* source) override;
void EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) override;
void ExitFullscreenModeForTab(content::WebContents* source) override;
bool IsFullscreenForTabOrPending(
const content::WebContents* source) const override;
// Implementations of content::WebContentsObserver.
void RenderViewCreated(content::RenderViewHost* render_view_host) override;

View file

@ -44,7 +44,7 @@ class NativeWindowMac : public NativeWindow {
void Restore() override;
bool IsMinimized() override;
void SetFullScreen(bool fullscreen) override;
bool IsFullscreen() override;
bool IsFullscreen() const override;
void SetSize(const gfx::Size& size) override;
gfx::Size GetSize() override;
void SetContentSize(const gfx::Size& size) override;

View file

@ -476,7 +476,7 @@ void NativeWindowMac::SetFullScreen(bool fullscreen) {
[window_ toggleFullScreen:nil];
}
bool NativeWindowMac::IsFullscreen() {
bool NativeWindowMac::IsFullscreen() const {
return [window_ styleMask] & NSFullScreenWindowMask;
}

View file

@ -369,7 +369,7 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) {
#endif
}
bool NativeWindowViews::IsFullscreen() {
bool NativeWindowViews::IsFullscreen() const {
return window_->IsFullscreen();
}

View file

@ -49,7 +49,7 @@ class NativeWindowViews : public NativeWindow,
void Restore() override;
bool IsMinimized() override;
void SetFullScreen(bool fullscreen) override;
bool IsFullscreen() override;
bool IsFullscreen() const override;
void SetSize(const gfx::Size& size) override;
gfx::Size GetSize() override;
void SetContentSize(const gfx::Size& size) override;