| 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 /** | 7 /** |
| 8 * @type {string} The host id corresponding to the user's VM. The @pending | 8 * @type {string} The host id corresponding to the user's VM. The @pending |
| 9 * place-holder instructs the Orchestrator to abandon any pending host, | 9 * place-holder instructs the Orchestrator to abandon any pending host, |
| 10 * and is used if no host id is provided by the main window. | 10 * and is used if no host id is provided by the main window. |
| 11 */ | 11 */ |
| 12 var hostId = '@pending'; | 12 var hostId = '@pending'; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * @type {string} The network stats at the time the feedback consent dialog | 15 * @type {string} The network stats at the time the feedback consent dialog |
| 16 * was shown. | 16 * was shown. |
| 17 */ | 17 */ |
| 18 var connectionStats = ''; | 18 var connectionStats = ''; |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * @type {string} The most recent id for the session (unless the session is |
| 22 * longer than 24hrs, this will be the only session id). |
| 23 */ |
| 24 var sessionId = ''; |
| 25 |
| 26 /** |
| 21 * @type {string} "no" => user did not request a VM reset; "yes" => VM was | 27 * @type {string} "no" => user did not request a VM reset; "yes" => VM was |
| 22 * successfully reset; "failed" => user requested a reset, but it failed. | 28 * successfully reset; "failed" => user requested a reset, but it failed. |
| 23 */ | 29 */ |
| 24 var abandonHost = 'no'; | 30 var abandonHost = 'no'; |
| 25 | 31 |
| 26 /** | 32 /** |
| 27 * @type {Window} The main application window. | 33 * @type {Window} The main application window. |
| 28 */ | 34 */ |
| 29 var applicationWindow = null; | 35 var applicationWindow = null; |
| 30 | 36 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 52 var locale = chrome.i18n.getMessage('@@ui_locale'); | 58 var locale = chrome.i18n.getMessage('@@ui_locale'); |
| 53 | 59 |
| 54 window.open(url + | 60 window.open(url + |
| 55 '?productId=' + productId + | 61 '?productId=' + productId + |
| 56 '&bucket=' + escape(bucket) + | 62 '&bucket=' + escape(bucket) + |
| 57 '&hl=' + escape(locale) + | 63 '&hl=' + escape(locale) + |
| 58 '&psd_email=' + escape(email) + | 64 '&psd_email=' + escape(email) + |
| 59 '&psd_hostId=' + escape(hostId) + | 65 '&psd_hostId=' + escape(hostId) + |
| 60 '&psd_abandonHost=' + escape(abandonHost) + | 66 '&psd_abandonHost=' + escape(abandonHost) + |
| 61 '&psd_crashServiceReportId=' + escape(crashServiceReportId) + | 67 '&psd_crashServiceReportId=' + escape(crashServiceReportId) + |
| 62 '&psd_connectionStats=' + escape(connectionStats)); | 68 '&psd_connectionStats=' + escape(connectionStats) + |
| 69 '&psd_sessionId=' + escape(sessionId)); |
| 63 window.close(); | 70 window.close(); |
| 64 | 71 |
| 65 // If the VM was successfully abandoned, close the application. | 72 // If the VM was successfully abandoned, close the application. |
| 66 if (abandonHost == 'yes') { | 73 if (abandonHost == 'yes') { |
| 67 applicationWindow.close(); | 74 applicationWindow.close(); |
| 68 } | 75 } |
| 69 }; | 76 }; |
| 70 | 77 |
| 71 /** | 78 /** |
| 72 * @param {boolean} waiting | 79 * @param {boolean} waiting |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 225 |
| 219 /** @param {Event} event */ | 226 /** @param {Event} event */ |
| 220 function onWindowMessage(event) { | 227 function onWindowMessage(event) { |
| 221 applicationWindow = event.source; | 228 applicationWindow = event.source; |
| 222 var method = /** @type {string} */ (event.data['method']); | 229 var method = /** @type {string} */ (event.data['method']); |
| 223 if (method == 'init') { | 230 if (method == 'init') { |
| 224 if (event.data['hostId']) { | 231 if (event.data['hostId']) { |
| 225 hostId = /** @type {string} */ (event.data['hostId']); | 232 hostId = /** @type {string} */ (event.data['hostId']); |
| 226 } | 233 } |
| 227 connectionStats = /** @type {string} */ (event.data['connectionStats']); | 234 connectionStats = /** @type {string} */ (event.data['connectionStats']); |
| 235 sessionId = /** @type {string} */ (event.data['sessionId']); |
| 228 } | 236 } |
| 229 }; | 237 }; |
| 230 | 238 |
| 231 window.addEventListener('load', onLoad, false); | 239 window.addEventListener('load', onLoad, false); |
| OLD | NEW |