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 * This class implements the functionality that is specific to application | 7 * This class implements the functionality that is specific to application |
8 * remoting ("AppRemoting" or AR). | 8 * remoting ("AppRemoting" or AR). |
9 */ | 9 */ |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 | 86 |
87 /** | 87 /** |
88 * @return {string} Application product name to be used in UI. | 88 * @return {string} Application product name to be used in UI. |
89 * @override {remoting.ApplicationInterface} | 89 * @override {remoting.ApplicationInterface} |
90 */ | 90 */ |
91 remoting.AppRemoting.prototype.getApplicationName = function() { | 91 remoting.AppRemoting.prototype.getApplicationName = function() { |
92 var manifest = chrome.runtime.getManifest(); | 92 var manifest = chrome.runtime.getManifest(); |
93 return manifest.name; | 93 return manifest.name; |
94 }; | 94 }; |
95 | 95 |
96 remoting.AppRemoting.prototype.getActivity = function() { | |
kelvinp
2015/04/14 23:16:32
This will be fixed to expose the correct activity
| |
97 return null; | |
98 }; | |
99 | |
96 /** | 100 /** |
97 * @param {!remoting.Error} error The failure reason. | 101 * @param {!remoting.Error} error The failure reason. |
98 * @override {remoting.ApplicationInterface} | 102 * @override {remoting.ApplicationInterface} |
99 */ | 103 */ |
100 remoting.AppRemoting.prototype.signInFailed_ = function(error) { | 104 remoting.AppRemoting.prototype.signInFailed_ = function(error) { |
101 this.onError(error); | 105 this.onError(error); |
102 }; | 106 }; |
103 | 107 |
104 /** | 108 /** |
105 * @override {remoting.ApplicationInterface} | 109 * @override {remoting.ApplicationInterface} |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 response.host.hostId) { | 152 response.host.hostId) { |
149 var hostJid = response.hostJid; | 153 var hostJid = response.hostJid; |
150 that.contextMenu_.setHostId(response.host.hostId); | 154 that.contextMenu_.setHostId(response.host.hostId); |
151 var host = new remoting.Host(response.host.hostId); | 155 var host = new remoting.Host(response.host.hostId); |
152 host.jabberId = hostJid; | 156 host.jabberId = hostJid; |
153 host.authorizationCode = response.authorizationCode; | 157 host.authorizationCode = response.authorizationCode; |
154 host.sharedSecret = response.sharedSecret; | 158 host.sharedSecret = response.sharedSecret; |
155 | 159 |
156 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); | 160 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
157 | 161 |
158 var idleDetector = new remoting.IdleDetector( | |
159 document.getElementById('idle-dialog'), | |
160 remoting.app.disconnect.bind(remoting.app)); | |
161 | |
162 /** | 162 /** |
163 * @param {string} tokenUrl Token-issue URL received from the host. | 163 * @param {string} tokenUrl Token-issue URL received from the host. |
164 * @param {string} hostPublicKey Host public key (DER and Base64 | 164 * @param {string} hostPublicKey Host public key (DER and Base64 |
165 * encoded). | 165 * encoded). |
166 * @param {string} scope OAuth scope to request the token for. | 166 * @param {string} scope OAuth scope to request the token for. |
167 * @param {function(string, string):void} onThirdPartyTokenFetched | 167 * @param {function(string, string):void} onThirdPartyTokenFetched |
168 * Callback. | 168 * Callback. |
169 */ | 169 */ |
170 var fetchThirdPartyToken = function( | 170 var fetchThirdPartyToken = function( |
171 tokenUrl, hostPublicKey, scope, onThirdPartyTokenFetched) { | 171 tokenUrl, hostPublicKey, scope, onThirdPartyTokenFetched) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 | 205 |
206 /** | 206 /** |
207 * @param {remoting.ConnectionInfo} connectionInfo | 207 * @param {remoting.ConnectionInfo} connectionInfo |
208 */ | 208 */ |
209 remoting.AppRemoting.prototype.onConnected = function(connectionInfo) { | 209 remoting.AppRemoting.prototype.onConnected = function(connectionInfo) { |
210 this.supportsGoogleDrive_ = connectionInfo.session().hasCapability( | 210 this.supportsGoogleDrive_ = connectionInfo.session().hasCapability( |
211 remoting.ClientSession.Capability.GOOGLE_DRIVE); | 211 remoting.ClientSession.Capability.GOOGLE_DRIVE); |
212 | 212 |
213 connectionInfo.plugin().extensions().register(this); | 213 connectionInfo.plugin().extensions().register(this); |
214 | 214 |
215 var session = connectionInfo.session(); | |
216 var idleDetector = new remoting.IdleDetector( | |
kelvinp
2015/04/14 23:16:32
The IdleDetector should be started only when the s
| |
217 document.getElementById('idle-dialog'), | |
218 session.disconnect.bind(session, remoting.Error.none())); | |
219 | |
215 this.connectedView_ = new remoting.AppConnectedView( | 220 this.connectedView_ = new remoting.AppConnectedView( |
216 document.getElementById('client-container'), connectionInfo); | 221 document.getElementById('client-container'), connectionInfo); |
217 | 222 |
218 // Map Cmd to Ctrl on Mac since hosts typically use Ctrl for keyboard | 223 // Map Cmd to Ctrl on Mac since hosts typically use Ctrl for keyboard |
219 // shortcuts, but we want them to act as natively as possible. | 224 // shortcuts, but we want them to act as natively as possible. |
220 if (remoting.platformIsMac()) { | 225 if (remoting.platformIsMac()) { |
221 connectionInfo.plugin().setRemapKeys('0x0700e3>0x0700e0,0x0700e7>0x0700e4'); | 226 connectionInfo.plugin().setRemapKeys('0x0700e3>0x0700e0,0x0700e7>0x0700e4'); |
222 } | 227 } |
223 }; | 228 }; |
224 | 229 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 }; | 379 }; |
375 | 380 |
376 /** | 381 /** |
377 * @return {string} | 382 * @return {string} |
378 * @private | 383 * @private |
379 */ | 384 */ |
380 remoting.AppRemoting.prototype.runApplicationUrl_ = function() { | 385 remoting.AppRemoting.prototype.runApplicationUrl_ = function() { |
381 return remoting.settings.APP_REMOTING_API_BASE_URL + '/applications/' + | 386 return remoting.settings.APP_REMOTING_API_BASE_URL + '/applications/' + |
382 remoting.settings.getAppRemotingApplicationId() + '/run'; | 387 remoting.settings.getAppRemotingApplicationId() + '/run'; |
383 }; | 388 }; |
OLD | NEW |