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 28 matching lines...) Expand all Loading... |
59 | 65 |
60 window.open(url + | 66 window.open(url + |
61 '?productId=' + productId + | 67 '?productId=' + productId + |
62 '&bucket=' + escape(bucket) + | 68 '&bucket=' + escape(bucket) + |
63 '&hl=' + escape(locale) + | 69 '&hl=' + escape(locale) + |
64 '&psd_email=' + escape(email) + | 70 '&psd_email=' + escape(email) + |
65 '&psd_hostId=' + escape(hostId) + | 71 '&psd_hostId=' + escape(hostId) + |
66 '&psd_abandonHost=' + escape(abandonHost) + | 72 '&psd_abandonHost=' + escape(abandonHost) + |
67 '&psd_crashServiceReportId=' + escape(crashServiceReportId) + | 73 '&psd_crashServiceReportId=' + escape(crashServiceReportId) + |
68 '&psd_connectionStats=' + escape(connectionStats) + | 74 '&psd_connectionStats=' + escape(connectionStats) + |
69 '&psd_category=' + escape(selectedCategory)); | 75 '&psd_category=' + escape(selectedCategory) + |
| 76 '&psd_sessionId=' + escape(sessionId)); |
70 window.close(); | 77 window.close(); |
71 | 78 |
72 // If the VM was successfully abandoned, close the application. | 79 // If the VM was successfully abandoned, close the application. |
73 if (abandonHost == 'yes') { | 80 if (abandonHost == 'yes') { |
74 applicationWindow.close(); | 81 applicationWindow.close(); |
75 } | 82 } |
76 }; | 83 }; |
77 | 84 |
78 /** | 85 /** |
79 * @param {boolean} waiting | 86 * @param {boolean} waiting |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 242 |
236 /** @param {Event} event */ | 243 /** @param {Event} event */ |
237 function onWindowMessage(event) { | 244 function onWindowMessage(event) { |
238 applicationWindow = event.source; | 245 applicationWindow = event.source; |
239 var method = /** @type {string} */ (event.data['method']); | 246 var method = /** @type {string} */ (event.data['method']); |
240 if (method == 'init') { | 247 if (method == 'init') { |
241 if (event.data['hostId']) { | 248 if (event.data['hostId']) { |
242 hostId = /** @type {string} */ (event.data['hostId']); | 249 hostId = /** @type {string} */ (event.data['hostId']); |
243 } | 250 } |
244 connectionStats = /** @type {string} */ (event.data['connectionStats']); | 251 connectionStats = /** @type {string} */ (event.data['connectionStats']); |
| 252 sessionId = /** @type {string} */ (event.data['sessionId']); |
245 } | 253 } |
246 }; | 254 }; |
247 | 255 |
248 window.addEventListener('load', onLoad, false); | 256 window.addEventListener('load', onLoad, false); |
OLD | NEW |