| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
| 8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Initialize the host list. | 11 * Initialize the host list. |
| 12 */ | 12 */ |
| 13 remoting.initHostlist_ = function() { | 13 remoting.initHostlist_ = function() { |
| 14 remoting.hostController = new remoting.HostController(); |
| 14 remoting.hostList = new remoting.HostList( | 15 remoting.hostList = new remoting.HostList( |
| 15 document.getElementById('host-list'), | 16 document.getElementById('host-list'), |
| 16 document.getElementById('host-list-empty'), | 17 document.getElementById('host-list-empty'), |
| 17 document.getElementById('host-list-error-message'), | 18 document.getElementById('host-list-error-message'), |
| 18 document.getElementById('host-list-refresh-failed-button'), | 19 document.getElementById('host-list-refresh-failed-button'), |
| 19 document.getElementById('host-list-loading-indicator')); | 20 document.getElementById('host-list-loading-indicator')); |
| 20 | 21 |
| 21 isHostModeSupported_().then( | 22 isHostModeSupported_().then( |
| 22 /** @param {Boolean} supported */ | 23 /** @param {Boolean} supported */ |
| 23 function(supported) { | 24 function(supported) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 98 } |
| 98 | 99 |
| 99 return remoting.HostInstaller.isInstalled(); | 100 return remoting.HostInstaller.isInstalled(); |
| 100 } | 101 } |
| 101 | 102 |
| 102 /** | 103 /** |
| 103 * initHomeScreenUi is called if the app is not starting up in session mode, | 104 * initHomeScreenUi is called if the app is not starting up in session mode, |
| 104 * and also if the user cancels pin entry or the connection in session mode. | 105 * and also if the user cancels pin entry or the connection in session mode. |
| 105 */ | 106 */ |
| 106 remoting.initHomeScreenUi = function() { | 107 remoting.initHomeScreenUi = function() { |
| 107 remoting.hostController = new remoting.HostController(); | |
| 108 remoting.setMode(remoting.AppMode.HOME); | 108 remoting.setMode(remoting.AppMode.HOME); |
| 109 remoting.hostSetupDialog = | |
| 110 new remoting.HostSetupDialog(remoting.hostController); | |
| 111 var dialog = document.getElementById('paired-clients-list'); | 109 var dialog = document.getElementById('paired-clients-list'); |
| 112 var message = document.getElementById('paired-client-manager-message'); | 110 var message = document.getElementById('paired-client-manager-message'); |
| 113 var deleteAll = document.getElementById('delete-all-paired-clients'); | 111 var deleteAll = document.getElementById('delete-all-paired-clients'); |
| 114 var close = document.getElementById('close-paired-client-manager-dialog'); | 112 var close = document.getElementById('close-paired-client-manager-dialog'); |
| 115 var working = document.getElementById('paired-client-manager-dialog-working'); | 113 var working = document.getElementById('paired-client-manager-dialog-working'); |
| 116 var error = document.getElementById('paired-client-manager-dialog-error'); | 114 var error = document.getElementById('paired-client-manager-dialog-error'); |
| 117 var noPairedClients = document.getElementById('no-paired-clients'); | 115 var noPairedClients = document.getElementById('no-paired-clients'); |
| 118 remoting.pairedClientManager = | 116 remoting.pairedClientManager = |
| 119 new remoting.PairedClientManager(remoting.hostController, dialog, message, | 117 new remoting.PairedClientManager(remoting.hostController, dialog, message, |
| 120 deleteAll, close, noPairedClients, | 118 deleteAll, close, noPairedClients, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 197 } |
| 200 | 198 |
| 201 | 199 |
| 202 remoting.startDesktopRemoting = function() { | 200 remoting.startDesktopRemoting = function() { |
| 203 remoting.app = new remoting.Application(remoting.app_capabilities()); | 201 remoting.app = new remoting.Application(remoting.app_capabilities()); |
| 204 var desktop_remoting = new remoting.DesktopRemoting(remoting.app); | 202 var desktop_remoting = new remoting.DesktopRemoting(remoting.app); |
| 205 remoting.app.start(); | 203 remoting.app.start(); |
| 206 }; | 204 }; |
| 207 | 205 |
| 208 window.addEventListener('load', remoting.startDesktopRemotingForTesting, false); | 206 window.addEventListener('load', remoting.startDesktopRemotingForTesting, false); |
| OLD | NEW |