From be5715103773e945f492ae905cc8f2be31376e02 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Fri, 8 May 2015 11:48:15 +0530 Subject: [PATCH 1/6] webContents: override fullscreen notification apis for webview --- atom/browser/api/atom_api_web_contents.cc | 20 ++++++++++++++++++++ atom/browser/api/atom_api_web_contents.h | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index b0f0a95ed2f..2bd496ffce7 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -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(), diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index eb69d65bf9a..5e9a93e3b5c 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -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; From 4fe294ed047c47d2c83942662c03b0e877dd774e Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Sat, 9 May 2015 17:47:40 +0530 Subject: [PATCH 2/6] check for renderviewhost availability before using --- atom/browser/api/atom_api_web_contents.cc | 22 ++++++++++++++-------- atom/browser/api/atom_api_web_contents.h | 6 +++--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 2bd496ffce7..02aa76fe6a0 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -215,20 +215,26 @@ void WebContents::HandleKeyboardEvent( web_contents(), event); } -void WebContents::EnterFullscreenModeForTab(content::WebContents* web_contents, +void WebContents::EnterFullscreenModeForTab(content::WebContents* source, const GURL& origin) { - GetWindowFromGuest(web_contents)->SetFullScreen(true); - web_contents->GetRenderViewHost()->WasResized(); + auto window = GetWindowFromGuest(source); + if (window) { + window->SetFullScreen(true); + source->GetRenderViewHost()->WasResized(); + } } -void WebContents::ExitFullscreenModeForTab(content::WebContents* web_contents) { - GetWindowFromGuest(web_contents)->SetFullScreen(false); - web_contents->GetRenderViewHost()->WasResized(); +void WebContents::ExitFullscreenModeForTab(content::WebContents* source) { + auto window = GetWindowFromGuest(source); + if (window) { + window->SetFullScreen(false); + source->GetRenderViewHost()->WasResized(); + } } bool WebContents::IsFullscreenForTabOrPending( - const content::WebContents* web_contents) const { - auto window = GetWindowFromGuest(web_contents); + const content::WebContents* source) const { + auto window = GetWindowFromGuest(source); if (window) return window->IsFullscreen(); else diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 5e9a93e3b5c..e1979a6dc5f 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -151,11 +151,11 @@ class WebContents : public mate::EventEmitter, void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; - void EnterFullscreenModeForTab(content::WebContents* web_contents, + void EnterFullscreenModeForTab(content::WebContents* source, const GURL& origin) override; - void ExitFullscreenModeForTab(content::WebContents* web_contents) override; + void ExitFullscreenModeForTab(content::WebContents* source) override; bool IsFullscreenForTabOrPending( - const content::WebContents* web_contents) const override; + const content::WebContents* source) const override; // content::WebContentsObserver: void RenderViewDeleted(content::RenderViewHost*) override; From ddda8e4197588d0c3f4d791c1f7d6263d61957db Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Sun, 17 May 2015 01:37:46 +0530 Subject: [PATCH 3/6] track html api triggered fullscreen separaely --- atom/browser/api/atom_api_web_contents.cc | 6 +++--- atom/browser/native_window.cc | 12 +++++++++--- atom/browser/native_window.h | 8 ++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 02aa76fe6a0..b0a6217988b 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -219,7 +219,7 @@ void WebContents::EnterFullscreenModeForTab(content::WebContents* source, const GURL& origin) { auto window = GetWindowFromGuest(source); if (window) { - window->SetFullScreen(true); + window->SetHtmlApiFullscreen(true); source->GetRenderViewHost()->WasResized(); } } @@ -227,7 +227,7 @@ void WebContents::EnterFullscreenModeForTab(content::WebContents* source, void WebContents::ExitFullscreenModeForTab(content::WebContents* source) { auto window = GetWindowFromGuest(source); if (window) { - window->SetFullScreen(false); + window->SetHtmlApiFullscreen(false); source->GetRenderViewHost()->WasResized(); } } @@ -236,7 +236,7 @@ bool WebContents::IsFullscreenForTabOrPending( const content::WebContents* source) const { auto window = GetWindowFromGuest(source); if (window) - return window->IsFullscreen(); + return window->IsHtmlApiFullscreen(); else return false; } diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 8bc2c4616fe..6ba941ff7dd 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -99,6 +99,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents, is_closed_(false), node_integration_(true), has_dialog_attached_(false), + fullscreen_(false), zoom_factor_(1.0), weak_factory_(this), inspectable_web_contents_( @@ -698,16 +699,16 @@ void NativeWindow::RendererResponsive(content::WebContents* source) { void NativeWindow::EnterFullscreenModeForTab(content::WebContents* source, const GURL& origin) { - SetFullScreen(true); + SetHtmlApiFullscreen(true); } void NativeWindow::ExitFullscreenModeForTab(content::WebContents* source) { - SetFullScreen(false); + SetHtmlApiFullscreen(false); } bool NativeWindow::IsFullscreenForTabOrPending( const content::WebContents* source) const { - return IsFullscreen(); + return IsHtmlApiFullscreen(); } void NativeWindow::BeforeUnloadFired(const base::TimeTicks& proceed_time) { @@ -800,6 +801,11 @@ void NativeWindow::ScheduleUnresponsiveEvent(int ms) { base::TimeDelta::FromMilliseconds(ms)); } +void NativeWindow::SetHtmlApiFullscreen(bool enter_fullscreen) { + SetFullScreen(enter_fullscreen); + fullscreen_ = enter_fullscreen; +} + void NativeWindow::NotifyWindowUnresponsive() { window_unresposive_closure_.Cancel(); diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index 39c58625ad2..ae53fba76f1 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -195,6 +195,9 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, int child_process_id); void OverrideWebkitPrefs(content::WebPreferences* prefs); + // Set fullscreen mode triggered by html api. + void SetHtmlApiFullscreen(bool enter_fullscreen); + // Public API used by platform-dependent delegates and observers to send UI // related notifications. void NotifyWindowClosed(); @@ -217,6 +220,8 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, bool has_frame() const { return has_frame_; } + bool IsHtmlApiFullscreen() const { return fullscreen_; } + void set_has_dialog_attached(bool has_dialog_attached) { has_dialog_attached_ = has_dialog_attached; } @@ -343,6 +348,9 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, // There is a dialog that has been attached to window. bool has_dialog_attached_; + // Whether window is fullscreened by HTML5 api. + bool fullscreen_; + // Closure that would be called when window is unresponsive when closing, // it should be cancelled when we can prove that the window is responsive. base::CancelableClosure window_unresposive_closure_; From f2d91bc53c4e7445f4a331d5c36f16390826a4f0 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Sun, 17 May 2015 02:31:30 +0530 Subject: [PATCH 4/6] adding events to notify fullscreen state --- atom/browser/api/atom_api_window.cc | 8 ++++++++ atom/browser/api/atom_api_window.h | 2 ++ atom/browser/native_window.cc | 4 ++++ atom/browser/native_window_observer.h | 2 ++ docs/api/browser-window.md | 8 ++++++++ 5 files changed, 24 insertions(+) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index b71499d3699..252c8f92035 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -132,6 +132,14 @@ void Window::OnWindowLeaveFullScreen() { Emit("leave-full-screen"); } +void Window::OnWindowEnterHtmlFullScreen() { + Emit("enter-html-full-screen"); +} + +void Window::OnWindowLeaveHtmlFullScreen() { + Emit("leave-html-full-screen"); +} + void Window::OnRendererUnresponsive() { Emit("unresponsive"); } diff --git a/atom/browser/api/atom_api_window.h b/atom/browser/api/atom_api_window.h index d5c3ceedd2e..8aa1ed0988d 100644 --- a/atom/browser/api/atom_api_window.h +++ b/atom/browser/api/atom_api_window.h @@ -66,6 +66,8 @@ class Window : public mate::EventEmitter, void OnWindowRestore() override; void OnWindowEnterFullScreen() override; void OnWindowLeaveFullScreen() override; + void OnWindowEnterHtmlFullScreen() override; + void OnWindowLeaveHtmlFullScreen() override; void OnRendererUnresponsive() override; void OnRendererResponsive() override; void OnDevToolsFocus() override; diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 6ba941ff7dd..7d00483b20c 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -700,10 +700,14 @@ void NativeWindow::RendererResponsive(content::WebContents* source) { void NativeWindow::EnterFullscreenModeForTab(content::WebContents* source, const GURL& origin) { SetHtmlApiFullscreen(true); + FOR_EACH_OBSERVER(NativeWindowObserver, observers_, + OnWindowEnterHtmlFullScreen()); } void NativeWindow::ExitFullscreenModeForTab(content::WebContents* source) { SetHtmlApiFullscreen(false); + FOR_EACH_OBSERVER(NativeWindowObserver, observers_, + OnWindowLeaveHtmlFullScreen()); } bool NativeWindow::IsFullscreenForTabOrPending( diff --git a/atom/browser/native_window_observer.h b/atom/browser/native_window_observer.h index aa582494673..8c09e832a82 100644 --- a/atom/browser/native_window_observer.h +++ b/atom/browser/native_window_observer.h @@ -49,6 +49,8 @@ class NativeWindowObserver { virtual void OnWindowRestore() {} virtual void OnWindowEnterFullScreen() {} virtual void OnWindowLeaveFullScreen() {} + virtual void OnWindowEnterHtmlFullScreen() {} + virtual void OnWindowLeaveHtmlFullScreen() {} // Called when devtools window gets focused. virtual void OnDevToolsFocus() {} diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 4eb3eb33273..97844a8690e 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -179,6 +179,14 @@ Emitted when window enters full screen state. Emitted when window leaves full screen state. +### Event: 'enter-html-full-screen' + +Emitted when window enters full screen state triggered by html api. + +### Event: 'leave-html-full-screen' + +Emitted when window leaves full screen state triggered by html api. + ### Event: 'devtools-opened' Emitted when devtools is opened. From 0dcf061dc1c4bfc4e02489f9659c45bbde244eb4 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Tue, 19 May 2015 14:06:19 +0530 Subject: [PATCH 5/6] check if window is html or forced fullscreen --- atom/browser/api/atom_api_web_contents.cc | 2 ++ atom/browser/lib/guest-view-manager.coffee | 2 ++ atom/browser/native_window.cc | 18 ++++++++++++++++-- atom/browser/native_window.h | 7 +++++-- .../lib/web-view/guest-view-internal.coffee | 2 ++ docs/api/web-view-tag.md | 8 ++++++++ 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index b0a6217988b..f72a4c4d168 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -221,6 +221,7 @@ void WebContents::EnterFullscreenModeForTab(content::WebContents* source, if (window) { window->SetHtmlApiFullscreen(true); source->GetRenderViewHost()->WasResized(); + Emit("enter-html-full-screen"); } } @@ -229,6 +230,7 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) { if (window) { window->SetHtmlApiFullscreen(false); source->GetRenderViewHost()->WasResized(); + Emit("leave-html-full-screen"); } } diff --git a/atom/browser/lib/guest-view-manager.coffee b/atom/browser/lib/guest-view-manager.coffee index 9403466f27a..f0d2a89318d 100644 --- a/atom/browser/lib/guest-view-manager.coffee +++ b/atom/browser/lib/guest-view-manager.coffee @@ -20,6 +20,8 @@ supportedWebViewEvents = [ 'destroyed' 'page-title-set' 'page-favicon-updated' + 'enter-html-full-screen' + 'leave-html-full-screen' ] nextInstanceId = 0 diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 7d00483b20c..79ea407f3da 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -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() { diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index ae53fba76f1..f23c27ebf77 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -220,7 +220,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, bool has_frame() const { return has_frame_; } - bool IsHtmlApiFullscreen() const { return fullscreen_; } + bool IsHtmlApiFullscreen() const { return html_fullscreen_; } void set_has_dialog_attached(bool has_dialog_attached) { has_dialog_attached_ = has_dialog_attached; @@ -349,7 +349,10 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, bool has_dialog_attached_; // Whether window is fullscreened by HTML5 api. - bool fullscreen_; + bool html_fullscreen_; + + // Whether window is fullscreened by window api. + bool forced_fullscreen_; // Closure that would be called when window is unresponsive when closing, // it should be cancelled when we can prove that the window is responsive. diff --git a/atom/renderer/lib/web-view/guest-view-internal.coffee b/atom/renderer/lib/web-view/guest-view-internal.coffee index fb1b40d27e1..e856896ae61 100644 --- a/atom/renderer/lib/web-view/guest-view-internal.coffee +++ b/atom/renderer/lib/web-view/guest-view-internal.coffee @@ -22,6 +22,8 @@ WEB_VIEW_EVENTS = 'destroyed': [] 'page-title-set': ['title', 'explicitSet'] 'page-favicon-updated': ['favicons'] + 'enter-html-full-screen': [] + 'leave-html-full-screen': [] dispatchEvent = (webView, event, args...) -> throw new Error("Unkown event #{event}") unless WEB_VIEW_EVENTS[event]? diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 5536920c5b7..f607f0d225b 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -361,6 +361,14 @@ url. Fired when page receives favicon urls. +### enter-html-full-screen + +Fired when page enters fullscreen triggered by html api. + +### leave-html-full-screen + +Fired when page leaves fullscreen triggered by html api. + ### console-message * `level` Integer From e8a02316ce78b684b03f3363daf4c1f9ddd891fe Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 21 May 2015 10:39:31 +0530 Subject: [PATCH 6/6] also emit html fullscreen notification on windows when its webview contents trigger it --- atom/browser/api/atom_api_web_contents.cc | 4 +- atom/browser/native_window.cc | 55 +++++++++++++---------- atom/browser/native_window.h | 6 ++- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index f72a4c4d168..734434aff1a 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -220,6 +220,7 @@ void WebContents::EnterFullscreenModeForTab(content::WebContents* source, auto window = GetWindowFromGuest(source); if (window) { window->SetHtmlApiFullscreen(true); + window->NotifyWindowEnterHtmlFullScreen(); source->GetRenderViewHost()->WasResized(); Emit("enter-html-full-screen"); } @@ -229,6 +230,7 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) { auto window = GetWindowFromGuest(source); if (window) { window->SetHtmlApiFullscreen(false); + window->NotifyWindowLeaveHtmlFullScreen(); source->GetRenderViewHost()->WasResized(); Emit("leave-html-full-screen"); } @@ -238,7 +240,7 @@ bool WebContents::IsFullscreenForTabOrPending( const content::WebContents* source) const { auto window = GetWindowFromGuest(source); if (window) - return window->IsHtmlApiFullscreen(); + return window->is_html_api_fullscreen(); else return false; } diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 79ea407f3da..e937bbdfccf 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -100,6 +100,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents, node_integration_(true), has_dialog_attached_(false), html_fullscreen_(false), + native_fullscreen_(false), zoom_factor_(1.0), weak_factory_(this), inspectable_web_contents_( @@ -477,6 +478,25 @@ void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) { } } +void NativeWindow::SetHtmlApiFullscreen(bool enter_fullscreen) { + // Window is already in fullscreen mode, save the state. + if (enter_fullscreen && IsFullscreen()) { + native_fullscreen_ = true; + html_fullscreen_ = true; + return; + } + + // Exit html fullscreen state but not window's fullscreen mode. + if (!enter_fullscreen && native_fullscreen_) { + html_fullscreen_ = false; + return; + } + + SetFullScreen(enter_fullscreen); + html_fullscreen_ = enter_fullscreen; + native_fullscreen_ = false; +} + void NativeWindow::NotifyWindowClosed() { if (is_closed_) return; @@ -525,6 +545,16 @@ void NativeWindow::NotifyWindowLeaveFullScreen() { OnWindowLeaveFullScreen()); } +void NativeWindow::NotifyWindowEnterHtmlFullScreen() { + FOR_EACH_OBSERVER(NativeWindowObserver, observers_, + OnWindowEnterHtmlFullScreen()); +} + +void NativeWindow::NotifyWindowLeaveHtmlFullScreen() { + FOR_EACH_OBSERVER(NativeWindowObserver, observers_, + OnWindowLeaveHtmlFullScreen()); +} + bool NativeWindow::ShouldCreateWebContents( content::WebContents* web_contents, int route_id, @@ -700,19 +730,15 @@ void NativeWindow::RendererResponsive(content::WebContents* source) { void NativeWindow::EnterFullscreenModeForTab(content::WebContents* source, const GURL& origin) { SetHtmlApiFullscreen(true); - FOR_EACH_OBSERVER(NativeWindowObserver, observers_, - OnWindowEnterHtmlFullScreen()); } void NativeWindow::ExitFullscreenModeForTab(content::WebContents* source) { SetHtmlApiFullscreen(false); - FOR_EACH_OBSERVER(NativeWindowObserver, observers_, - OnWindowLeaveHtmlFullScreen()); } bool NativeWindow::IsFullscreenForTabOrPending( const content::WebContents* source) const { - return IsHtmlApiFullscreen(); + return is_html_api_fullscreen(); } void NativeWindow::BeforeUnloadFired(const base::TimeTicks& proceed_time) { @@ -805,25 +831,6 @@ void NativeWindow::ScheduleUnresponsiveEvent(int ms) { base::TimeDelta::FromMilliseconds(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); - html_fullscreen_ = enter_fullscreen; - forced_fullscreen_ = false; -} - void NativeWindow::NotifyWindowUnresponsive() { window_unresposive_closure_.Cancel(); diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index f23c27ebf77..b114ecf510b 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -209,6 +209,8 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, void NotifyWindowRestore(); void NotifyWindowEnterFullScreen(); void NotifyWindowLeaveFullScreen(); + void NotifyWindowEnterHtmlFullScreen(); + void NotifyWindowLeaveHtmlFullScreen(); void AddObserver(NativeWindowObserver* obs) { observers_.AddObserver(obs); @@ -220,7 +222,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, bool has_frame() const { return has_frame_; } - bool IsHtmlApiFullscreen() const { return html_fullscreen_; } + bool is_html_api_fullscreen() const { return html_fullscreen_; } void set_has_dialog_attached(bool has_dialog_attached) { has_dialog_attached_ = has_dialog_attached; @@ -352,7 +354,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, bool html_fullscreen_; // Whether window is fullscreened by window api. - bool forced_fullscreen_; + bool native_fullscreen_; // Closure that would be called when window is unresponsive when closing, // it should be cancelled when we can prove that the window is responsive.