Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: remoting/webapp/crd/js/ui_mode.js

Issue 952353002: Requiem for client_screen.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + Ready for Check-in Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/webapp/crd/js/toolbar.js ('k') | remoting/webapp/crd/js/window_frame.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Functions related to controlling the modal UI state of the app. UI states 7 * Functions related to controlling the modal UI state of the app. UI states
8 * are expressed as HTML attributes with a dotted hierarchy. For example, the 8 * are expressed as HTML attributes with a dotted hierarchy. For example, the
9 * string 'host.shared' will match any elements with an associated attribute 9 * string 'host.shared' will match any elements with an associated attribute
10 * of 'host' or 'host.shared', showing those elements and hiding all others. 10 * of 'host' or 'host.shared', showing those elements and hiding all others.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 * 116 *
117 * @param {remoting.AppMode} mode The new modal state. 117 * @param {remoting.AppMode} mode The new modal state.
118 */ 118 */
119 remoting.setMode = function(mode) { 119 remoting.setMode = function(mode) {
120 remoting.updateModalUi(mode, 'data-ui-mode'); 120 remoting.updateModalUi(mode, 'data-ui-mode');
121 console.log('App mode: ' + mode); 121 console.log('App mode: ' + mode);
122 remoting.currentMode = mode; 122 remoting.currentMode = mode;
123 if (mode == remoting.AppMode.IN_SESSION) { 123 if (mode == remoting.AppMode.IN_SESSION) {
124 document.removeEventListener('keydown', remoting.ConnectionStats.onKeydown, 124 document.removeEventListener('keydown', remoting.ConnectionStats.onKeydown,
125 false); 125 false);
126 if ('hidden' in document) {
127 document.addEventListener('visibilitychange',
128 remoting.onVisibilityChanged, false);
129 } else {
130 document.addEventListener('webkitvisibilitychange',
131 remoting.onVisibilityChanged, false);
132 }
133 } else { 126 } else {
134 document.addEventListener('keydown', remoting.ConnectionStats.onKeydown, 127 document.addEventListener('keydown', remoting.ConnectionStats.onKeydown,
135 false); 128 false);
136 document.removeEventListener('visibilitychange',
137 remoting.onVisibilityChanged, false);
138 document.removeEventListener('webkitvisibilitychange',
139 remoting.onVisibilityChanged, false);
140 // TODO(jamiewalch): crbug.com/252796: Remove this once crbug.com/240772 129 // TODO(jamiewalch): crbug.com/252796: Remove this once crbug.com/240772
141 // is fixed. 130 // is fixed.
142 var scroller = document.getElementById('scroller'); 131 var scroller = document.getElementById('scroller');
143 if (scroller) { 132 if (scroller) {
144 scroller.classList.remove('no-horizontal-scroll'); 133 scroller.classList.remove('no-horizontal-scroll');
145 scroller.classList.remove('no-vertical-scroll'); 134 scroller.classList.remove('no-vertical-scroll');
146 } 135 }
147 } 136 }
148 137
149 remoting.testEvents.raiseEvent(remoting.testEvents.Names.uiModeChanged, mode); 138 remoting.testEvents.raiseEvent(remoting.testEvents.Names.uiModeChanged, mode);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 284 }
296 285
297 /** 286 /**
298 * @param {string} tag 287 * @param {string} tag
299 */ 288 */
300 remoting.showSetupProcessingMessage = function(tag) { 289 remoting.showSetupProcessingMessage = function(tag) {
301 var messageDiv = document.getElementById('host-setup-processing-message'); 290 var messageDiv = document.getElementById('host-setup-processing-message');
302 l10n.localizeElementFromTag(messageDiv, tag); 291 l10n.localizeElementFromTag(messageDiv, tag);
303 remoting.setMode(remoting.AppMode.HOST_SETUP_PROCESSING); 292 remoting.setMode(remoting.AppMode.HOST_SETUP_PROCESSING);
304 } 293 }
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/toolbar.js ('k') | remoting/webapp/crd/js/window_frame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698