| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
| 6 * @type {string} | 6 * @type {string} |
| 7 * @const | 7 * @const |
| 8 */ | 8 */ |
| 9 var SRT_DOWNLOAD_PAGE = 'https://www.google.com/chrome/cleanup-tool/'; | 9 var SRT_DOWNLOAD_PAGE = 'https://www.google.com/chrome/cleanup-tool/'; |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // Prevent double clicking from sending additional reports. | 159 // Prevent double clicking from sending additional reports. |
| 160 $('send-report-button').disabled = true; | 160 $('send-report-button').disabled = true; |
| 161 console.log('Feedback: Sending report'); | 161 console.log('Feedback: Sending report'); |
| 162 if (!feedbackInfo.attachedFile && attachedFileBlob) { | 162 if (!feedbackInfo.attachedFile && attachedFileBlob) { |
| 163 feedbackInfo.attachedFile = { name: $('attach-file').value, | 163 feedbackInfo.attachedFile = { name: $('attach-file').value, |
| 164 data: attachedFileBlob }; | 164 data: attachedFileBlob }; |
| 165 } | 165 } |
| 166 | 166 |
| 167 feedbackInfo.description = $('description-text').value; | 167 feedbackInfo.description = $('description-text').value; |
| 168 feedbackInfo.pageUrl = $('page-url-text').value; | 168 feedbackInfo.pageUrl = $('page-url-text').value; |
| 169 feedbackInfo.email = $('user-email-text').value; | 169 feedbackInfo.email = $('user-email-drop-down').value; |
| 170 | 170 |
| 171 var useSystemInfo = false; | 171 var useSystemInfo = false; |
| 172 var useHistograms = false; | 172 var useHistograms = false; |
| 173 if ($('sys-info-checkbox') != null && | 173 if ($('sys-info-checkbox') != null && |
| 174 $('sys-info-checkbox').checked) { | 174 $('sys-info-checkbox').checked) { |
| 175 // Send histograms along with system info. | 175 // Send histograms along with system info. |
| 176 useSystemInfo = useHistograms = true; | 176 useSystemInfo = useHistograms = true; |
| 177 } | 177 } |
| 178 // <if expr="chromeos"> | 178 // <if expr="chromeos"> |
| 179 if ($('performance-info-checkbox') == null || | 179 if ($('performance-info-checkbox') == null || |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 chrome.app.window.current().show(); | 337 chrome.app.window.current().show(); |
| 338 | 338 |
| 339 var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); | 339 var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); |
| 340 $('screenshot-image').src = screenshotDataUrl; | 340 $('screenshot-image').src = screenshotDataUrl; |
| 341 $('screenshot-image').classList.toggle('wide-screen', | 341 $('screenshot-image').classList.toggle('wide-screen', |
| 342 $('screenshot-image').width > MAX_SCREENSHOT_WIDTH); | 342 $('screenshot-image').width > MAX_SCREENSHOT_WIDTH); |
| 343 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); | 343 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); |
| 344 }); | 344 }); |
| 345 | 345 |
| 346 chrome.feedbackPrivate.getUserEmail(function(email) { | 346 chrome.feedbackPrivate.getUserEmail(function(email) { |
| 347 $('user-email-text').value = email; | 347 var optionElement = document.createElement('option'); |
| 348 optionElement.value = email; |
| 349 optionElement.text = email; |
| 350 optionElement.selected = true; |
| 351 // Make sure the "Report anonymously" option comes last. |
| 352 $('user-email-drop-down').insertBefore(optionElement, |
| 353 $('anonymous-user-option')); |
| 348 }); | 354 }); |
| 349 | 355 |
| 350 // Initiate getting the system info. | 356 // Initiate getting the system info. |
| 351 isSystemInfoReady = false; | 357 isSystemInfoReady = false; |
| 352 getSystemInformation(onSystemInformation); | 358 getSystemInformation(onSystemInformation); |
| 353 | 359 |
| 354 // An extension called us with an attached file. | 360 // An extension called us with an attached file. |
| 355 if (feedbackInfo.attachedFile) { | 361 if (feedbackInfo.attachedFile) { |
| 356 $('attached-filename-text').textContent = | 362 $('attached-filename-text').textContent = |
| 357 feedbackInfo.attachedFile.name; | 363 feedbackInfo.attachedFile.name; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 $('cancel-button').onclick = cancel; | 444 $('cancel-button').onclick = cancel; |
| 439 $('remove-attached-file').onclick = clearAttachedFile; | 445 $('remove-attached-file').onclick = clearAttachedFile; |
| 440 // <if expr="chromeos"> | 446 // <if expr="chromeos"> |
| 441 $('performance-info-checkbox').addEventListener( | 447 $('performance-info-checkbox').addEventListener( |
| 442 'change', performanceFeedbackChanged); | 448 'change', performanceFeedbackChanged); |
| 443 // </if> | 449 // </if> |
| 444 }); | 450 }); |
| 445 } | 451 } |
| 446 | 452 |
| 447 initialize(); | 453 initialize(); |
| OLD | NEW |