if (window) {
window->SetHtmlApiFullscreen(true);
source->GetRenderViewHost()->WasResized();
+ Emit("enter-html-full-screen");
}
}
if (window) {
window->SetHtmlApiFullscreen(false);
source->GetRenderViewHost()->WasResized();
+ Emit("leave-html-full-screen");
}
}
'destroyed'
'page-title-set'
'page-favicon-updated'
+ 'enter-html-full-screen'
+ 'leave-html-full-screen'
]
nextInstanceId = 0
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_(
}
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() {
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;
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.
'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]?
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