OLD | NEW |
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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** @constructor */ | 10 /** @constructor */ |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 * @param {XMLHttpRequest} xhr */ | 150 * @param {XMLHttpRequest} xhr */ |
151 function onRegistered(privateKey, xhr) { | 151 function onRegistered(privateKey, xhr) { |
152 var success = (xhr.status == 200); | 152 var success = (xhr.status == 200); |
153 | 153 |
154 if (success) { | 154 if (success) { |
155 var hostSecretHash = | 155 var hostSecretHash = |
156 'hmac:' + that.plugin_.getPinHash(newHostId, hostPin); | 156 'hmac:' + that.plugin_.getPinHash(newHostId, hostPin); |
157 var hostConfig = JSON.stringify({ | 157 var hostConfig = JSON.stringify({ |
158 xmpp_login: remoting.oauth2.getCachedEmail(), | 158 xmpp_login: remoting.oauth2.getCachedEmail(), |
159 oauth_refresh_token: remoting.oauth2.exportRefreshToken(), | 159 oauth_refresh_token: remoting.oauth2.exportRefreshToken(), |
| 160 oauth_use_official_client_id: |
| 161 remoting.oauth2.USE_OFFICIAL_CLIENT_ID, |
160 host_id: newHostId, | 162 host_id: newHostId, |
161 host_name: hostName, | 163 host_name: hostName, |
162 host_secret_hash: hostSecretHash, | 164 host_secret_hash: hostSecretHash, |
163 private_key: privateKey | 165 private_key: privateKey |
164 }); | 166 }); |
165 /** @param {remoting.HostController.AsyncResult} result */ | 167 /** @param {remoting.HostController.AsyncResult} result */ |
166 var onStartDaemon = function(result) { | 168 var onStartDaemon = function(result) { |
167 onStarted(callback, result, hostName); | 169 onStarted(callback, result, hostName); |
168 }; | 170 }; |
169 that.plugin_.startDaemon(hostConfig, onStartDaemon); | 171 that.plugin_.startDaemon(hostConfig, onStartDaemon); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 if (hostId && typeof(hostId) == 'string') { | 318 if (hostId && typeof(hostId) == 'string') { |
317 this.setHost(hostList.getHostForId(/** @type{string} */(hostId))); | 319 this.setHost(hostList.getHostForId(/** @type{string} */(hostId))); |
318 } else { | 320 } else { |
319 this.setHost(null); | 321 this.setHost(null); |
320 } | 322 } |
321 onDone(); | 323 onDone(); |
322 }; | 324 }; |
323 | 325 |
324 /** @type {remoting.HostController} */ | 326 /** @type {remoting.HostController} */ |
325 remoting.hostController = null; | 327 remoting.hostController = null; |
OLD | NEW |