Skip to content

Commit

Permalink
Unify full-screen and fullscreen CSS.
Browse files Browse the repository at this point in the history
ClientSession registers for full-screen events only while connected, which
can result in a race-condition whereby the property is not removed when the
app is windowed. When the apps v2 custom window frame was added, a separate
"fullscreen" property was added to the <body> node with the same semantics,
so the simplest fix is just to get rid of "full-screen" in favour of the
always-updated "fullscreen", and to update apps v1 to also maintain that
property.

Review URL: https://codereview.chromium.org/727563002

Cr-Commit-Position: refs/heads/master@{#304258}
  • Loading branch information
jamiewalch authored and Commit bot committed Nov 14, 2014
1 parent 332265b commit 1ba19b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion remoting/webapp/base/html/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ html.apps-v2.scrollable {
* no scroll-bars, so the advantages of flex-box layout to achieve centering
* (ie, the DOM is easier to measure to determine when scroll-bars are needed)
* don't apply */
.full-screen #session-mode {
.fullscreen #session-mode {
position: fixed;
top: 0;
left: 0;
Expand Down
6 changes: 0 additions & 6 deletions remoting/webapp/crd/js/client_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -1302,13 +1302,7 @@ remoting.ClientSession.prototype.requestPairing = function(clientName, onDone) {
* @private
*/
remoting.ClientSession.prototype.onFullScreenChanged_ = function (fullscreen) {
var htmlNode = /** @type {HTMLElement} */ (document.documentElement);
this.enableBumpScroll_(fullscreen);
if (fullscreen) {
htmlNode.classList.add('full-screen');
} else {
htmlNode.classList.remove('full-screen');
}
};

/**
Expand Down
5 changes: 5 additions & 0 deletions remoting/webapp/crd/js/fullscreen_v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ remoting.FullscreenAppsV1.prototype.onFullscreenChanged_ = function() {
window.setTimeout(
/** @this {remoting.FullscreenAppsV1} */
function() {
if (this.isActive()) {
document.body.classList.add('fullscreen');
} else {
document.body.classList.remove('fullscreen');
}
this.eventSource_.raiseEvent(this.kEventName_, this.isActive());
}.bind(this),
500);
Expand Down

0 comments on commit 1ba19b1

Please sign in to comment.