Chromium Code Reviews| 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 = |
| 170 $('user-email-drop-down').options[ | |
|
xiyuan
2017/03/02 19:23:33
feedbackInfo.email = $('user-email-drop-down').val
afakhry
2017/03/02 19:56:05
Oh, I didn't know we could do that!
Done.
| |
| 171 $('user-email-drop-down').selectedIndex].value; | |
| 170 | 172 |
| 171 var useSystemInfo = false; | 173 var useSystemInfo = false; |
| 172 var useHistograms = false; | 174 var useHistograms = false; |
| 173 if ($('sys-info-checkbox') != null && | 175 if ($('sys-info-checkbox') != null && |
| 174 $('sys-info-checkbox').checked) { | 176 $('sys-info-checkbox').checked) { |
| 175 // Send histograms along with system info. | 177 // Send histograms along with system info. |
| 176 useSystemInfo = useHistograms = true; | 178 useSystemInfo = useHistograms = true; |
| 177 } | 179 } |
| 178 // <if expr="chromeos"> | 180 // <if expr="chromeos"> |
| 179 if ($('performance-info-checkbox') == null || | 181 if ($('performance-info-checkbox') == null || |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 chrome.app.window.current().show(); | 339 chrome.app.window.current().show(); |
| 338 | 340 |
| 339 var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); | 341 var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); |
| 340 $('screenshot-image').src = screenshotDataUrl; | 342 $('screenshot-image').src = screenshotDataUrl; |
| 341 $('screenshot-image').classList.toggle('wide-screen', | 343 $('screenshot-image').classList.toggle('wide-screen', |
| 342 $('screenshot-image').width > MAX_SCREENSHOT_WIDTH); | 344 $('screenshot-image').width > MAX_SCREENSHOT_WIDTH); |
| 343 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); | 345 feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); |
| 344 }); | 346 }); |
| 345 | 347 |
| 346 chrome.feedbackPrivate.getUserEmail(function(email) { | 348 chrome.feedbackPrivate.getUserEmail(function(email) { |
| 347 $('user-email-text').value = email; | 349 var optionElement = document.createElement('option'); |
| 350 optionElement.value = email; | |
| 351 optionElement.text = email; | |
| 352 optionElement.selected = true; | |
| 353 // Make sure the "Report anonymously" option comes last. | |
| 354 $('user-email-drop-down').insertBefore( | |
| 355 optionElement, $('user-email-drop-down').firstChild); | |
|
xiyuan
2017/03/02 19:23:33
oops, did not realized that $('user-email-drop-dow
afakhry
2017/03/02 19:56:05
Using the $('anonymous-user-option') instead.
| |
| 348 }); | 356 }); |
| 349 | 357 |
| 350 // Initiate getting the system info. | 358 // Initiate getting the system info. |
| 351 isSystemInfoReady = false; | 359 isSystemInfoReady = false; |
| 352 getSystemInformation(onSystemInformation); | 360 getSystemInformation(onSystemInformation); |
| 353 | 361 |
| 354 // An extension called us with an attached file. | 362 // An extension called us with an attached file. |
| 355 if (feedbackInfo.attachedFile) { | 363 if (feedbackInfo.attachedFile) { |
| 356 $('attached-filename-text').textContent = | 364 $('attached-filename-text').textContent = |
| 357 feedbackInfo.attachedFile.name; | 365 feedbackInfo.attachedFile.name; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 $('cancel-button').onclick = cancel; | 446 $('cancel-button').onclick = cancel; |
| 439 $('remove-attached-file').onclick = clearAttachedFile; | 447 $('remove-attached-file').onclick = clearAttachedFile; |
| 440 // <if expr="chromeos"> | 448 // <if expr="chromeos"> |
| 441 $('performance-info-checkbox').addEventListener( | 449 $('performance-info-checkbox').addEventListener( |
| 442 'change', performanceFeedbackChanged); | 450 'change', performanceFeedbackChanged); |
| 443 // </if> | 451 // </if> |
| 444 }); | 452 }); |
| 445 } | 453 } |
| 446 | 454 |
| 447 initialize(); | 455 initialize(); |
| OLD | NEW |