Chromium Code Reviews| Index: chrome/browser/resources/feedback/js/feedback.js |
| diff --git a/chrome/browser/resources/feedback/js/feedback.js b/chrome/browser/resources/feedback/js/feedback.js |
| index ddb8685804db9f8ce0eceb812deeb36d823e1993..03d793260e0a8c163bec357f22df3381ed3e90f0 100644 |
| --- a/chrome/browser/resources/feedback/js/feedback.js |
| +++ b/chrome/browser/resources/feedback/js/feedback.js |
| @@ -160,8 +160,10 @@ function sendReport() { |
| $('send-report-button').disabled = true; |
| console.log('Feedback: Sending report'); |
| if (!feedbackInfo.attachedFile && attachedFileBlob) { |
| - feedbackInfo.attachedFile = { name: $('attach-file').value, |
| - data: attachedFileBlob }; |
| + feedbackInfo.attachedFile = { |
| + name: $('attach-file').value, |
| + data: attachedFileBlob |
| + }; |
| } |
| feedbackInfo.description = $('description-text').value; |
| @@ -170,17 +172,16 @@ function sendReport() { |
| var useSystemInfo = false; |
| var useHistograms = false; |
| - if ($('sys-info-checkbox') != null && |
| - $('sys-info-checkbox').checked) { |
| + if ($('sys-info-checkbox') != null && $('sys-info-checkbox').checked) { |
| // Send histograms along with system info. |
| useSystemInfo = useHistograms = true; |
| } |
| -<if expr="chromeos"> |
| + // <if expr="chromeos"> |
| if ($('performance-info-checkbox') == null || |
| !($('performance-info-checkbox').checked)) { |
| feedbackInfo.traceId = null; |
| } |
| -</if> |
| + // </if> |
| feedbackInfo.sendHistograms = useHistograms; |
| @@ -229,7 +230,7 @@ function dataUrlToBlob(url) { |
| return new Blob([new Uint8Array(dataArray)], {type: mimeString}); |
| } |
| -<if expr="chromeos"> |
| +// <if expr="chromeos"> |
| /** |
| * Update the page when performance feedback state is changed. |
| */ |
| @@ -245,7 +246,7 @@ function performanceFeedbackChanged() { |
| $('screenshot-checkbox').disabled = false; |
| } |
| } |
| -</if> |
| +// </if> |
| function resizeAppWindow() { |
| // We pick the width from the titlebar, which has no margins. |
| @@ -256,8 +257,8 @@ function resizeAppWindow() { |
| // We get the height by adding the titlebar height and the content height + |
| // margins. We can't get the margins for the content-pane here by using |
| // style.margin - the variable seems to not exist. |
| - var height = $('title-bar').scrollHeight + |
| - $('content-pane').scrollHeight + CONTENT_MARGIN_HEIGHT; |
| + var height = $('title-bar').scrollHeight + $('content-pane').scrollHeight + |
| + CONTENT_MARGIN_HEIGHT; |
| var minHeight = FEEDBACK_MIN_HEIGHT; |
| if (feedbackInfo.flow == FeedbackFlow.LOGIN) |
| @@ -338,8 +339,10 @@ function initialize() { |
| var screenshotDataUrl = screenshotCanvas.toDataURL('image/png'); |
| $('screenshot-image').src = screenshotDataUrl; |
| - $('screenshot-image').classList.toggle('wide-screen', |
| - $('screenshot-image').width > MAX_SCREENSHOT_WIDTH); |
| + $('screenshot-image') |
| + .classList.toggle( |
| + 'wide-screen', |
| + $('screenshot-image').width > MAX_SCREENSHOT_WIDTH); |
| feedbackInfo.screenshot = dataUrlToBlob(screenshotDataUrl); |
| }); |
| @@ -367,14 +370,14 @@ function initialize() { |
| $('attach-file-note').hidden = true; |
| } |
| -<if expr="chromeos"> |
| + // <if expr="chromeos"> |
| if (feedbackInfo.traceId && ($('performance-info-area'))) { |
| $('performance-info-area').hidden = false; |
| $('performance-info-checkbox').checked = true; |
| performanceFeedbackChanged(); |
| $('performance-info-link').onclick = openSlowTraceWindow; |
| } |
| -</if> |
| + // </if> |
| chrome.feedbackPrivate.getStrings(function(strings) { |
| loadTimeData.data = strings; |
| i18nTemplate.process(document, loadTimeData); |
| @@ -389,32 +392,33 @@ function initialize() { |
| return; |
| } |
| chrome.app.window.create( |
| - '/html/sys_info.html', { |
| - frame: 'chrome', |
| - id: SYSINFO_WINDOW_ID, |
| - width: 640, |
| - height: 400, |
| - hidden: false, |
| - resizable: true |
| - }, function(appWindow) { |
| - // Define functions for the newly created window. |
| - |
| - // Gets the full system information for the new window. |
| - appWindow.contentWindow.getFullSystemInfo = |
| - function(callback) { |
| - if (isSystemInfoReady) { |
| - callback(feedbackInfo.systemInformation); |
| - return; |
| - } |
| - |
| - sysInfoPageOnSysInfoReadyCallback = callback; |
| - }; |
| - |
| - // Returns the loadTimeData for the new window. |
| - appWindow.contentWindow.getLoadTimeData = function() { |
| - return loadTimeData; |
| - }; |
| - }); |
| + '/html/sys_info.html', { |
| + frame: 'chrome', |
| + id: SYSINFO_WINDOW_ID, |
| + width: 640, |
| + height: 400, |
| + hidden: false, |
| + resizable: true |
| + }, |
| + function(appWindow) { |
| + // Define functions for the newly created window. |
| + |
| + // Gets the full system information for the new window. |
| + appWindow.contentWindow.getFullSystemInfo = function( |
| + callback) { |
| + if (isSystemInfoReady) { |
| + callback(feedbackInfo.systemInformation); |
| + return; |
| + } |
| + |
| + sysInfoPageOnSysInfoReadyCallback = callback; |
| + }; |
| + |
| + // Returns the loadTimeData for the new window. |
| + appWindow.contentWindow.getLoadTimeData = function() { |
| + return loadTimeData; |
| + }; |
| + }); |
| }; |
| } |
| if ($('histograms-url')) { |
| @@ -437,10 +441,10 @@ function initialize() { |
| $('send-report-button').onclick = sendReport; |
| $('cancel-button').onclick = cancel; |
| $('remove-attached-file').onclick = clearAttachedFile; |
| -<if expr="chromeos"> |
| - $('performance-info-checkbox').addEventListener( |
| - 'change', performanceFeedbackChanged); |
| -</if> |
| + // <if expr="chromeos"> |
|
dschuyler
2016/12/28 23:59:12
Just pointing this out in case it hadn't been noti
Dan Beam
2016/12/29 00:02:05
we're probably gonna have to change these to cr.is
|
| + $('performance-info-checkbox') |
| + .addEventListener('change', performanceFeedbackChanged); |
| + // </if> |
| }); |
| } |