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

Side by Side Diff: remoting/webapp/me2mom/remoting.js

Issue 8782001: Refactored HostList to better support bookmarking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Linter and rebase. Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /** @type {remoting.HostSession} */ remoting.hostSession = null; 10 /** @type {remoting.HostSession} */ remoting.hostSession = null;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (email) { 46 if (email) {
47 document.getElementById('current-email').innerText = email; 47 document.getElementById('current-email').innerText = email;
48 } 48 }
49 49
50 window.addEventListener('blur', pluginLostFocus_, false); 50 window.addEventListener('blur', pluginLostFocus_, false);
51 51
52 // Parse URL parameters. 52 // Parse URL parameters.
53 var urlParams = getUrlParameters(); 53 var urlParams = getUrlParameters();
54 if ('mode' in urlParams) { 54 if ('mode' in urlParams) {
55 if (urlParams['mode'] == 'me2me') { 55 if (urlParams['mode'] == 'me2me') {
56 var hostJid = urlParams['hostJid']; 56 var hostId = urlParams['hostId'];
57 var hostPublicKey = urlParams['hostPublicKey']; 57 remoting.connectHost(hostId, true);
58 var hostName = urlParams['hostName'];
59 remoting.connectHost(hostJid, hostPublicKey, hostName);
60 return; 58 return;
61 } 59 }
62 } 60 }
63 61
64 // No valid URL parameters, start up normally. 62 // No valid URL parameters, start up normally.
65 remoting.setMode(getAppStartupMode_()); 63 remoting.setMode(getAppStartupMode_());
66 if (isHostModeSupported_()) { 64 if (isHostModeSupported_()) {
67 var noShare = document.getElementById('chrome-os-no-share'); 65 var noShare = document.getElementById('chrome-os-no-share');
68 noShare.parentNode.removeChild(noShare); 66 noShare.parentNode.removeChild(noShare);
69 } else { 67 } else {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 /** 170 /**
173 * Returns whether Host mode is supported on this platform. 171 * Returns whether Host mode is supported on this platform.
174 * 172 *
175 * @return {boolean} True if Host mode is supported. 173 * @return {boolean} True if Host mode is supported.
176 */ 174 */
177 function isHostModeSupported_() { 175 function isHostModeSupported_() {
178 // Currently, sharing on Chromebooks is not supported. 176 // Currently, sharing on Chromebooks is not supported.
179 return !navigator.userAgent.match(/\bCrOS\b/); 177 return !navigator.userAgent.match(/\bCrOS\b/);
180 } 178 }
181 }()); 179 }());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698