| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * | 7 * |
| 8 * It2MeHelpeeChannel relays messages between the Hangouts web page (Hangouts) | 8 * It2MeHelpeeChannel relays messages between the Hangouts web page (Hangouts) |
| 9 * and the It2Me Native Messaging Host (It2MeHost) for the helpee (the Hangouts | 9 * and the It2Me Native Messaging Host (It2MeHost) for the helpee (the Hangouts |
| 10 * participant who is receiving remoting assistance). | 10 * participant who is receiving remoting assistance). |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 * @param {Bounds} bounds the bounds of the Hangouts Window. If set, the | 316 * @param {Bounds} bounds the bounds of the Hangouts Window. If set, the |
| 317 * confirm dialog will be centered within |bounds|. | 317 * confirm dialog will be centered within |bounds|. |
| 318 * @return {Promise} A promise that will resolve if the user accepts remote | 318 * @return {Promise} A promise that will resolve if the user accepts remote |
| 319 * assistance or reject otherwise. | 319 * assistance or reject otherwise. |
| 320 * @private | 320 * @private |
| 321 */ | 321 */ |
| 322 remoting.It2MeHelpeeChannel.prototype.showConfirmDialogV2_ = function(bounds) { | 322 remoting.It2MeHelpeeChannel.prototype.showConfirmDialogV2_ = function(bounds) { |
| 323 var getToken = | 323 var getToken = |
| 324 base.Promise.as(chrome.identity.getAuthToken, [{interactive: false}]); | 324 base.Promise.as(chrome.identity.getAuthToken, [{interactive: false}]); |
| 325 | 325 |
| 326 return getToken.then( | 326 return getToken; |
| 327 /** @param {string} token */ | |
| 328 function(token) { | |
| 329 return remoting.HangoutConsentDialog.getInstance().show(Boolean(token), | |
| 330 bounds); | |
| 331 }); | |
| 332 }; | 327 }; |
| 333 | 328 |
| 334 /** | 329 /** |
| 335 * @return {Promise} A promise that resolves when the host is initialized. | 330 * @return {Promise} A promise that resolves when the host is initialized. |
| 336 * @private | 331 * @private |
| 337 */ | 332 */ |
| 338 remoting.It2MeHelpeeChannel.prototype.initializeHost_ = function() { | 333 remoting.It2MeHelpeeChannel.prototype.initializeHost_ = function() { |
| 339 /** @type {remoting.It2MeHostFacade} */ | 334 /** @type {remoting.It2MeHostFacade} */ |
| 340 var host = this.host_; | 335 var host = this.host_; |
| 341 | 336 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 463 |
| 469 console.error('Error responding to message method:' + | 464 console.error('Error responding to message method:' + |
| 470 (incomingMessage ? incomingMessage.method : 'null') + | 465 (incomingMessage ? incomingMessage.method : 'null') + |
| 471 ' error:' + error); | 466 ' error:' + error); |
| 472 this.hangoutPort_.postMessage({ | 467 this.hangoutPort_.postMessage({ |
| 473 method: remoting.It2MeHelpeeChannel.HangoutMessageTypes.ERROR, | 468 method: remoting.It2MeHelpeeChannel.HangoutMessageTypes.ERROR, |
| 474 message: error, | 469 message: error, |
| 475 request: incomingMessage | 470 request: incomingMessage |
| 476 }); | 471 }); |
| 477 }; | 472 }; |
| OLD | NEW |