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

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

Issue 2867223003: Send a message to the client if bad It2Me policies are read. (Closed)
Patch Set: Fix race. Created 3 years, 7 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/base/js/error.js ('k') | remoting/webapp/crd/js/host_session.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 the 'host screen' for Chromoting. 7 * Functions related to the 'host screen' for Chromoting.
8 */ 8 */
9 9
10 /** @suppress {duplicate} */ 10 /** @suppress {duplicate} */
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 remoting.ChromotingEvent.SessionState.CONNECTING); 118 remoting.ChromotingEvent.SessionState.CONNECTING);
119 document.getElementById('cancel-share-button').disabled = false; 119 document.getElementById('cancel-share-button').disabled = false;
120 disableTimeoutCountdown_(); 120 disableTimeoutCountdown_();
121 121
122 console.assert(hostSession_ === null, '|hostSession_| already exists.'); 122 console.assert(hostSession_ === null, '|hostSession_| already exists.');
123 hostSession_ = new remoting.HostSession(); 123 hostSession_ = new remoting.HostSession();
124 remoting.identity.getEmail().then( 124 remoting.identity.getEmail().then(
125 function(/** string */ email) { 125 function(/** string */ email) {
126 hostSession_.connect( 126 hostSession_.connect(
127 hostFacade, email, token, onHostStateChanged_, 127 hostFacade, email, token, onHostStateChanged_,
128 onNatTraversalPolicyChanged_, logDebugInfo_, it2meConnectFailed_); 128 onNatTraversalPolicyChanged_, logDebugInfo_, showShareError_);
129 }); 129 });
130 }; 130 };
131 131
132 /** 132 /**
133 * Callback for the host plugin to notify the web app of state changes. 133 * Callback for the host plugin to notify the web app of state changes.
134 * @param {remoting.HostSession.State} state The new state of the plugin. 134 * @param {remoting.HostSession.State} state The new state of the plugin.
135 * @return {void} Nothing. 135 * @return {void} Nothing.
136 */ 136 */
137 function onHostStateChanged_(state) { 137 function onHostStateChanged_(state) {
138 if (state == remoting.HostSession.State.STARTING) { 138 if (state == remoting.HostSession.State.STARTING) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 l10n.localizeElementFromTag(errorDiv, error.getTag()); 240 l10n.localizeElementFromTag(errorDiv, error.getTag());
241 console.error('Sharing error: ' + error.toString()); 241 console.error('Sharing error: ' + error.toString());
242 remoting.setMode(remoting.AppMode.HOST_SHARE_FAILED); 242 remoting.setMode(remoting.AppMode.HOST_SHARE_FAILED);
243 it2meLogger.logSessionStateChange( 243 it2meLogger.logSessionStateChange(
244 remoting.ChromotingEvent.SessionState.CONNECTION_FAILED, error); 244 remoting.ChromotingEvent.SessionState.CONNECTION_FAILED, error);
245 } 245 }
246 246
247 cleanUp(); 247 cleanUp();
248 } 248 }
249 249
250 /**
251 * Show a sharing error with error code UNEXPECTED .
252 *
253 * @return {void} Nothing.
254 */
255 function it2meConnectFailed_() {
256 showShareError_(remoting.Error.unexpected());
257 }
258
259 function cleanUp() { 250 function cleanUp() {
260 base.dispose(hostSession_); 251 base.dispose(hostSession_);
261 hostSession_ = null; 252 hostSession_ = null;
262 } 253 }
263 254
264 /** 255 /**
265 * Cancel an active or pending it2me share operation. 256 * Cancel an active or pending it2me share operation.
266 * 257 *
267 * @return {void} Nothing. 258 * @return {void} Nothing.
268 */ 259 */
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 function createLogger_() { 381 function createLogger_() {
391 // Create a new logger for each session to refresh the session id. 382 // Create a new logger for each session to refresh the session id.
392 var logger = new remoting.SessionLogger( 383 var logger = new remoting.SessionLogger(
393 remoting.ChromotingEvent.Role.HOST, 384 remoting.ChromotingEvent.Role.HOST,
394 remoting.TelemetryEventWriter.Client.write); 385 remoting.TelemetryEventWriter.Client.write);
395 logger.setLogEntryMode(remoting.ChromotingEvent.Mode.IT2ME); 386 logger.setLogEntryMode(remoting.ChromotingEvent.Mode.IT2ME);
396 return logger; 387 return logger;
397 } 388 }
398 389
399 })(); 390 })();
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/error.js ('k') | remoting/webapp/crd/js/host_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698