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

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

Issue 937593002: Changed identity API to use promises instead of callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 }; 67 };
68 68
69 tryInitializeFacade(); 69 tryInitializeFacade();
70 }; 70 };
71 71
72 /** 72 /**
73 * @param {remoting.It2MeHostFacade} hostFacade An initialized It2MeHostFacade. 73 * @param {remoting.It2MeHostFacade} hostFacade An initialized It2MeHostFacade.
74 */ 74 */
75 remoting.startHostUsingFacade_ = function(hostFacade) { 75 remoting.startHostUsingFacade_ = function(hostFacade) {
76 console.log('Attempting to share...'); 76 console.log('Attempting to share...');
77 remoting.identity.callWithToken( 77 remoting.identity.getToken().then(
78 remoting.tryShareWithToken_.bind(null, hostFacade), 78 remoting.tryShareWithToken_.bind(null, hostFacade),
79 remoting.showErrorMessage); 79 remoting.Error.handler(remoting.showErrorMessage));
80 } 80 }
81 81
82 /** 82 /**
83 * @param {remoting.It2MeHostFacade} hostFacade An initialized 83 * @param {remoting.It2MeHostFacade} hostFacade An initialized
84 * It2MeHostFacade. 84 * It2MeHostFacade.
85 * @param {string} token The OAuth access token. 85 * @param {string} token The OAuth access token.
86 * @private 86 * @private
87 */ 87 */
88 remoting.tryShareWithToken_ = function(hostFacade, token) { 88 remoting.tryShareWithToken_ = function(hostFacade, token) {
89 lastShareWasCancelled_ = false; 89 lastShareWasCancelled_ = false;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 function onNatTraversalPolicyChanged_(enabled) { 330 function onNatTraversalPolicyChanged_(enabled) {
331 var natBox = document.getElementById('nat-box'); 331 var natBox = document.getElementById('nat-box');
332 if (enabled) { 332 if (enabled) {
333 natBox.classList.add('traversal-enabled'); 333 natBox.classList.add('traversal-enabled');
334 } else { 334 } else {
335 natBox.classList.remove('traversal-enabled'); 335 natBox.classList.remove('traversal-enabled');
336 } 336 }
337 } 337 }
338 338
339 })(); 339 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698