check if window is html or forced fullscreen

This commit is contained in:
deepak1556 2015-05-19 14:06:19 +05:30
parent f2d91bc53c
commit 0dcf061dc1
6 changed files with 35 additions and 4 deletions

View file

@ -99,7 +99,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
is_closed_(false),
node_integration_(true),
has_dialog_attached_(false),
fullscreen_(false),
html_fullscreen_(false),
zoom_factor_(1.0),
weak_factory_(this),
inspectable_web_contents_(
@ -806,8 +806,22 @@ void NativeWindow::ScheduleUnresponsiveEvent(int ms) {
}
void NativeWindow::SetHtmlApiFullscreen(bool enter_fullscreen) {
// Window is already in fullscreen mode, save the state.
if (enter_fullscreen && IsFullscreen()) {
forced_fullscreen_ = true;
html_fullscreen_ = true;
return;
}
// Exit html fullscreen state but not window's fullscreen mode.
if (!enter_fullscreen && forced_fullscreen_) {
html_fullscreen_ = false;
return;
}
SetFullScreen(enter_fullscreen);
fullscreen_ = enter_fullscreen;
html_fullscreen_ = enter_fullscreen;
forced_fullscreen_ = false;
}
void NativeWindow::NotifyWindowUnresponsive() {