window: supports HTML5 fullscreen api
This commit is contained in:
parent
67bc4afe88
commit
20b4cae980
6 changed files with 24 additions and 5 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -476,7 +476,7 @@ void NativeWindowMac::SetFullScreen(bool fullscreen) {
|
|||
[window_ toggleFullScreen:nil];
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsFullscreen() {
|
||||
bool NativeWindowMac::IsFullscreen() const {
|
||||
return [window_ styleMask] & NSFullScreenWindowMask;
|
||||
}
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) {
|
|||
#endif
|
||||
}
|
||||
|
||||
bool NativeWindowViews::IsFullscreen() {
|
||||
bool NativeWindowViews::IsFullscreen() const {
|
||||
return window_->IsFullscreen();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue