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

Unified Diff: remoting/webapp/me2mom/client_screen.js

Issue 8587050: Implement rename and delete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 1 month 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/me2mom/choice.html ('k') | remoting/webapp/me2mom/home_screen.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/client_screen.js
diff --git a/remoting/webapp/me2mom/client_screen.js b/remoting/webapp/me2mom/client_screen.js
index 3342d95f9674f277a6a0999197bbe56e0203e65e..ad690248ce82d1b94f6da4771147f44ecd55e541 100644
--- a/remoting/webapp/me2mom/client_screen.js
+++ b/remoting/webapp/me2mom/client_screen.js
@@ -392,31 +392,30 @@ function recenterToolbar_() {
* @return {void} Nothing.
*/
remoting.connectHost = function(hostId) {
- for (var i = 0; i < remoting.hostList.hosts.length; ++i) {
- /** @type {remoting.Host} */
- var host = remoting.hostList.hosts[i];
- if (host.hostId != hostId)
- continue;
+ var hostTableEntry = remoting.hostList.getHostForId(hostId);
+ if (!hostTableEntry) {
+ console.error('connectHost: Unrecognised hostId: ' + hostId);
+ return;
+ }
- remoting.hostJid = host.jabberId;
- remoting.hostPublicKey = host.publicKey;
- document.getElementById('connected-to').innerText = host.hostName;
+ remoting.hostJid = hostTableEntry.host.jabberId;
+ remoting.hostPublicKey = hostTableEntry.host.publicKey;
+ document.getElementById('connected-to').innerText =
+ hostTableEntry.host.hostName;
- remoting.debug.log('Connecting to host...');
+ remoting.debug.log('Connecting to host...');
- if (!remoting.wcsLoader) {
- remoting.wcsLoader = new remoting.WcsLoader();
- }
- /** @param {function(string):void} setToken The callback function. */
- var callWithToken = function(setToken) {
- remoting.oauth2.callWithToken(setToken);
- };
- remoting.wcsLoader.start(
- remoting.oauth2.getAccessToken(),
- callWithToken,
- remoting.connectHostWithWcs);
- break;
+ if (!remoting.wcsLoader) {
+ remoting.wcsLoader = new remoting.WcsLoader();
}
+ /** @param {function(string):void} setToken The callback function. */
+ var callWithToken = function(setToken) {
+ remoting.oauth2.callWithToken(setToken);
+ };
+ remoting.wcsLoader.start(
+ remoting.oauth2.getAccessToken(),
+ callWithToken,
+ remoting.connectHostWithWcs);
}
/**
« no previous file with comments | « remoting/webapp/me2mom/choice.html ('k') | remoting/webapp/me2mom/home_screen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698