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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 * @param {XMLHttpRequest} xhr */ | 146 * @param {XMLHttpRequest} xhr */ |
147 function onRegistered(privateKey, xhr) { | 147 function onRegistered(privateKey, xhr) { |
148 var success = (xhr.status == 200); | 148 var success = (xhr.status == 200); |
149 | 149 |
150 if (success) { | 150 if (success) { |
151 var hostSecretHash = | 151 var hostSecretHash = |
152 'hmac:' + that.plugin_.getPinHash(newHostId, hostPin); | 152 'hmac:' + that.plugin_.getPinHash(newHostId, hostPin); |
153 var hostConfig = JSON.stringify({ | 153 var hostConfig = JSON.stringify({ |
154 xmpp_login: remoting.oauth2.getCachedEmail(), | 154 xmpp_login: remoting.oauth2.getCachedEmail(), |
155 oauth_refresh_token: remoting.oauth2.exportRefreshToken(), | 155 oauth_refresh_token: remoting.oauth2.exportRefreshToken(), |
| 156 oauth_use_official_client_id: |
| 157 remoting.oauth2.USE_OFFICIAL_CLIENT_ID, |
156 host_id: newHostId, | 158 host_id: newHostId, |
157 host_name: hostName, | 159 host_name: hostName, |
158 host_secret_hash: hostSecretHash, | 160 host_secret_hash: hostSecretHash, |
159 private_key: privateKey | 161 private_key: privateKey |
160 }); | 162 }); |
161 /** @param {remoting.HostController.AsyncResult} result */ | 163 /** @param {remoting.HostController.AsyncResult} result */ |
162 var onStartDaemon = function(result) { | 164 var onStartDaemon = function(result) { |
163 onStarted(callback, result, hostName); | 165 onStarted(callback, result, hostName); |
164 }; | 166 }; |
165 that.plugin_.startDaemon(hostConfig, onStartDaemon); | 167 that.plugin_.startDaemon(hostConfig, onStartDaemon); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } else { | 317 } else { |
316 that.setHost(null); | 318 that.setHost(null); |
317 } | 319 } |
318 onDone(); | 320 onDone(); |
319 }; | 321 }; |
320 this.plugin_.getDaemonConfig(onConfig); | 322 this.plugin_.getDaemonConfig(onConfig); |
321 }; | 323 }; |
322 | 324 |
323 /** @type {remoting.HostController} */ | 325 /** @type {remoting.HostController} */ |
324 remoting.hostController = null; | 326 remoting.hostController = null; |
OLD | NEW |