summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options/advanced_options.js
diff options
context:
space:
mode:
authorpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-17 12:42:05 +0000
committerpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-17 12:42:05 +0000
commit0e9b60784cae677eab6e207260c2268f4ab55245 (patch)
tree07503a93dc5024137b728ad7ec87bc6b58d8df2f /chrome/browser/resources/options/advanced_options.js
parentefb1a423ddec13af4268c7d0fa7f984e9e9c6a8e (diff)
downloadchromium_src-0e9b60784cae677eab6e207260c2268f4ab55245.zip
chromium_src-0e9b60784cae677eab6e207260c2268f4ab55245.tar.gz
chromium_src-0e9b60784cae677eab6e207260c2268f4ab55245.tar.bz2
Implement the DownloadDirectory policy.
This policy allows for locking the user to download files only to the specified location. When the policy is set the UI elements should be inactive and the save dialog should never appear. Changes in the Preferences.xib file only wire the enabled status of the download location and save prompt checkbox elements to a variable that tracks the managed state of the DefaultDownloadDir pref. No UI elements were harmed in this change. BUG=59768 TEST=All old download manager tests shouldn't break. UI should behave correctly when policy is set. Review URL: http://codereview.chromium.org/6525054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/options/advanced_options.js')
-rw-r--r--chrome/browser/resources/options/advanced_options.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/resources/options/advanced_options.js b/chrome/browser/resources/options/advanced_options.js
index 996f651..cefd902 100644
--- a/chrome/browser/resources/options/advanced_options.js
+++ b/chrome/browser/resources/options/advanced_options.js
@@ -89,6 +89,10 @@ var OptionsPage = options.OptionsPage;
$('downloadLocationChangeButton').onclick = function(event) {
chrome.send('selectDownloadLocation');
};
+ $('promptForDownload').onclick = function(event) {
+ chrome.send('promptForDownloadAction',
+ [String($('promptForDownload').checked)]);
+ };
// Remove Windows-style accelerators from the Browse button label.
// TODO(csilv): Remove this after the accelerator has been removed from
@@ -200,9 +204,20 @@ var OptionsPage = options.OptionsPage;
};
// Set the download path.
- AdvancedOptions.SetDownloadLocationPath = function(path) {
+ AdvancedOptions.SetDownloadLocationPath = function(path, disabled) {
if (!cr.isChromeOS)
$('downloadLocationPath').value = path;
+ $('downloadLocationChangeButton').disabled = disabled;
+ };
+
+ // Set the prompt for download checkbox.
+ AdvancedOptions.SetPromptForDownload = function(checked, disabled) {
+ $('promptForDownload').checked = checked;
+ $('promptForDownload').disabled = disabled;
+ if (disabled)
+ $('promptForDownloadLabel').className = 'informational-text';
+ else
+ $('promptForDownloadLabel').className = '';
};
// Set the enabled state for the autoOpenFileTypesResetToDefault button.