Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: chrome/browser/resources/options/chromeos/internet_detail.js

Issue 13334007: Added "Use an autoconfiguration URL" checkbox in proxy tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src@git-svn
Patch Set: Fixed review comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/chromeos/internet_detail.js
diff --git a/chrome/browser/resources/options/chromeos/internet_detail.js b/chrome/browser/resources/options/chromeos/internet_detail.js
index b9e81e5f2eafff569bc0bd8e33e804a1e7c16590..fbcd3a2e9232b10d2af144bbe990646c159116f8 100644
--- a/chrome/browser/resources/options/chromeos/internet_detail.js
+++ b/chrome/browser/resources/options/chromeos/internet_detail.js
@@ -261,11 +261,14 @@ cr.define('options.internet', function() {
$('auto-proxy').addEventListener('click', this.disableManualProxy_);
$('proxy-all-protocols').addEventListener('click',
this.toggleSingleProxy_);
+ $('proxy-config-url').addEventListener('click',
+ this.toggleAutoConfigProxy_);
observePrefsUI($('direct-proxy'));
observePrefsUI($('manual-proxy'));
observePrefsUI($('auto-proxy'));
observePrefsUI($('proxy-all-protocols'));
+ observePrefsUI($('proxy-config-url'));
$('ip-automatic-configuration-checkbox').addEventListener('click',
this.handleIpAutoConfig_);
@@ -430,6 +433,21 @@ cr.define('options.internet', function() {
},
/**
+ * Handler for when the user clicks on the checkbox to enter
+ * auto configuration URL.
+ * @private
+ * @param {Event} e Click Event.
+ */
+ toggleAutoConfigProxy_: function(e) {
+ if ($('proxy-config-url').checked) {
+ $('proxy-config').disabled = false;
+ } else {
+ $('proxy-config').disabled = true;
+ $('proxy-config').textContent = '';
Dan Beam 2013/04/04 00:53:59 ^ hmmm, why do you want to clear the text content?
+ }
+ },
+
+ /**
* Handler for selecting a radio button that will disable the manual
* controls.
* @private
@@ -448,7 +466,9 @@ cr.define('options.internet', function() {
$('ftp-proxy-port').disabled = true;
$('socks-host').disabled = true;
$('socks-port').disabled = true;
- $('proxy-config').disabled = $('auto-proxy').disabled ||
+ $('proxy-config').disabled = $('proxy-config-url').disabled ||
+ !$('proxy-config-url').checked;
+ $('proxy-config-url').disabled = $('auto-proxy').disabled ||
!$('auto-proxy').checked;
Dan Beam 2013/04/04 00:53:59 nit: line this up like this: $('proxy-config-ur
},
@@ -477,6 +497,7 @@ cr.define('options.internet', function() {
$('socks-host').disabled = allDisabled;
$('socks-port').disabled = allDisabled;
$('proxy-config').disabled = true;
+ $('proxy-config-url').disabled = true;
},
};

Powered by Google App Engine
This is Rietveld 408576698