Chromium Code Reviews| Index: chrome/browser/resources/feedback.js |
| diff --git a/chrome/browser/resources/feedback.js b/chrome/browser/resources/feedback.js |
| index 92dce859b6975e039b8a497b335157f95e812657..91165f75d5f0c96d2fe2c9632a1d3de0a6805712 100644 |
| --- a/chrome/browser/resources/feedback.js |
| +++ b/chrome/browser/resources/feedback.js |
| @@ -15,6 +15,7 @@ savedThumbnailIds['current-screenshots'] = ''; |
| savedThumbnailIds['saved-screenshots'] = ''; |
| var categoryTag = ''; |
| +var forceDisableScreenshots = false; |
| /** |
| * Selects an image thumbnail in the specified div. |
| @@ -76,13 +77,10 @@ function addScreenshot(divId, screenshot) { |
| /** |
| * Disables screenshots completely. |
| */ |
| -function disableScreenshots() { |
| - $('screenshot-row').hidden = true; |
| - $('screenshot-checkbox').checked = false; |
|
Mattias Nissler (ping if slow)
2012/07/13 15:23:42
Why have you removed the updates to screenshot-che
qfel
2012/07/16 09:11:12
saved-screenshots and current-screenshots are insi
|
| - |
| - $('current-screenshots').hidden = true; |
| - if ($('saved-screenshots')) |
| - $('saved-screenshots').hidden = true; |
| +function enableScreenshots() { |
| + if (forceDisableScreenshots) |
| + return; |
| + $('screenshot-row').hidden = false; |
| } |
| /** |
| @@ -240,7 +238,8 @@ function load() { |
| if (parameters['customPageUrl'] != '') { |
| $('page-url-text').value = parameters['customPageUrl']; |
| // and disable the page image, since it doesn't make sense on a custum url. |
| - disableScreenshots(); |
| + $('screenshot-checkbox').checked = false; |
| + forceDisableScreenshots = true; |
| } |
| // Pick up the category tag (for most cases this will be an empty string) |
| @@ -278,24 +277,32 @@ function setupSavedScreenshots(screenshots) { |
| } |
| function setupDialogDefaults(defaults) { |
| - if (defaults.length > 0) { |
| - if ($('page-url-text').value == '') |
| - $('page-url-text').value = defaults[0]; |
| - if (defaults[0] == '') |
| - $('page-url-checkbox').checked = false; |
| - |
| - if (defaults.length > 2) { |
| - // We're in Chromium OS. |
| - $('user-email-text').textContent = defaults[2]; |
| - if (defaults[2] == '') { |
| - // if we didn't get an e-mail address from cros, |
| - // disable the user email display totally. |
| - $('user-email-table').hidden = true; |
| - |
| - // this also means we are in privacy mode, so no saved screenshots. |
| - $('screenshot-link-tosaved').hidden = true; |
| - } |
| - } |
| + // 0: current url |
| + if (defaults.length <= 0) |
| + return; |
| + if ($('page-url-text').value == '') |
| + $('page-url-text').value = defaults[0]; |
| + if (defaults[0] == '') |
| + $('page-url-checkbox').checked = false; |
| + |
| + // 1: are screenshots disabled? |
| + if (defaults.length <= 1) |
| + return; |
| + if (!defaults[1]) |
| + enableScreenshots(); |
| + |
| + // 2: user e-mail |
| + if (defaults.length <= 2) |
| + return; |
| + // We're in Chromium OS. |
| + $('user-email-text').textContent = defaults[2]; |
| + if (defaults[2] == '') { |
| + // if we didn't get an e-mail address from cros, |
| + // disable the user email display totally. |
| + $('user-email-table').hidden = true; |
| + |
| + // this also means we are in privacy mode, so no saved screenshots. |
| + $('screenshot-link-tosaved').hidden = true; |
| } |
| } |