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

Unified Diff: remoting/webapp/crd/js/host_screen.js

Issue 1370283004: [Chromoting] Remote Assistance in Public Session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PublicSession
Patch Set: Rebase Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/activation_handler.js ('k') | remoting/webapp/crd/js/it2me_host_facade.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_screen.js
diff --git a/remoting/webapp/crd/js/host_screen.js b/remoting/webapp/crd/js/host_screen.js
index 656a7038b43c31ab7d32cad046bf3d7ec13a2eaf..b0b61b99b6030c361ac2a1fc438d00c97a3f79f2 100644
--- a/remoting/webapp/crd/js/host_screen.js
+++ b/remoting/webapp/crd/js/host_screen.js
@@ -36,10 +36,7 @@ var it2meLogger = null;
* to install them if necessary.
*/
remoting.tryShare = function() {
- ensureIT2MeLogger_().then(tryShareWithLogger_);
-};
-
-function tryShareWithLogger_() {
+ ensureIT2MeLogger_();
it2meLogger.setSessionId();
it2meLogger.logClientSessionStateChange(
remoting.ClientSession.State.INITIALIZING, remoting.Error.none(), null);
@@ -79,11 +76,11 @@ function tryShareWithLogger_() {
*/
remoting.startHostUsingFacade_ = function(hostFacade) {
console.log('Attempting to share...');
- setHostVersion_()
- .then(remoting.identity.getToken.bind(remoting.identity))
- .then(remoting.tryShareWithToken_.bind(null, hostFacade),
- remoting.Error.handler(showShareError_));
-}
+ it2meLogger.setHostVersion(hostFacade.getHostVersion());
+ remoting.identity.getToken().then(
+ remoting.tryShareWithToken_.bind(null, hostFacade),
+ remoting.Error.handler(showShareError_));
+};
/**
* @param {remoting.It2MeHostFacade} hostFacade An initialized
@@ -364,13 +361,10 @@ function onNatTraversalPolicyChanged_(enabled) {
/**
* Create an IT2Me LogToServer instance if one does not already exist.
- *
- * @return {Promise} Promise that resolves when the host version (if available),
- * has been set on the logger instance.
*/
function ensureIT2MeLogger_() {
if (it2meLogger) {
- return Promise.resolve();
+ return;
}
var xmppConnection = new remoting.XmppConnection();
@@ -386,21 +380,6 @@ function ensureIT2MeLogger_() {
new remoting.BufferedSignalStrategy(xmppConnection);
it2meLogger = new remoting.LogToServer(bufferedSignalStrategy, true);
it2meLogger.setLogEntryMode(remoting.ChromotingEvent.Mode.IT2ME);
-
- return setHostVersion_();
-};
-
-/**
- * @return {Promise} Promise that resolves when the host version (if available),
- * has been set on the logger instance.
- */
-function setHostVersion_() {
- return remoting.hostController.getLocalHostVersion().then(
- function(/** string */ version) {
- it2meLogger.setHostVersion(version);
- }).catch(
- base.doNothing
- );
-};
+}
})();
« no previous file with comments | « remoting/webapp/crd/js/activation_handler.js ('k') | remoting/webapp/crd/js/it2me_host_facade.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698