summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorellyjones@chromium.org <ellyjones@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-20 04:12:48 +0000
committerellyjones@chromium.org <ellyjones@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-20 04:12:48 +0000
commit9af6d639460e0631c2b078397373445fbe2b67b9 (patch)
tree8868c9bf053a04d75880cf90281fc6a44d253c67
parentf006eedf680ba1bbd40d9fb06375696bc47fcc36 (diff)
downloadchromium_src-9af6d639460e0631c2b078397373445fbe2b67b9.zip
chromium_src-9af6d639460e0631c2b078397373445fbe2b67b9.tar.gz
chromium_src-9af6d639460e0631c2b078397373445fbe2b67b9.tar.bz2
net-internals: hide 'original proxy' if equal to effective proxy
When both are equal the display is somewhat visually noisy, so hide the original proxy div if the strings are equal and show it again when they begin to differ. You can test this by pressing 'reapply' on the proxy page, which will temporarily cause the original and effective proxy to differ. BUG=235998 TEST=adhoc Review URL: https://codereview.chromium.org/61953004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236137 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/net_internals/proxy_view.html12
-rw-r--r--chrome/browser/resources/net_internals/proxy_view.js14
2 files changed, 18 insertions, 8 deletions
diff --git a/chrome/browser/resources/net_internals/proxy_view.html b/chrome/browser/resources/net_internals/proxy_view.html
index cfe1335..b2c7548 100644
--- a/chrome/browser/resources/net_internals/proxy_view.html
+++ b/chrome/browser/resources/net_internals/proxy_view.html
@@ -21,11 +21,15 @@
<div id=proxy-view-tab-content class=content-box>
<input type=button value="Re-apply settings" id=proxy-view-reload-settings class="hide-when-not-capturing">
- <h4>Effective proxy settings</h4>
- <pre id=proxy-view-effective-settings></pre>
+ <div id=proxy-view-effective-content>
+ <h4>Effective proxy settings</h4>
+ <pre id=proxy-view-effective-settings></pre>
+ </div>
- <h4>Original proxy settings</h4>
- <pre id=proxy-view-original-settings></pre>
+ <div id=proxy-view-original-content>
+ <h4>Original proxy settings</h4>
+ <pre id=proxy-view-original-settings></pre>
+ </div>
<div id=proxy-view-socks-hints>
Note that some traffic such as DNS prefetching will NOT go through the proxy
diff --git a/chrome/browser/resources/net_internals/proxy_view.js b/chrome/browser/resources/net_internals/proxy_view.js
index 35263f9..ef9709d 100644
--- a/chrome/browser/resources/net_internals/proxy_view.js
+++ b/chrome/browser/resources/net_internals/proxy_view.js
@@ -44,6 +44,8 @@ var ProxyView = (function() {
ProxyView.MAIN_BOX_ID = 'proxy-view-tab-content';
ProxyView.ORIGINAL_SETTINGS_DIV_ID = 'proxy-view-original-settings';
ProxyView.EFFECTIVE_SETTINGS_DIV_ID = 'proxy-view-effective-settings';
+ ProxyView.ORIGINAL_CONTENT_DIV_ID = 'proxy-view-original-content';
+ ProxyView.EFFECTIVE_CONTENT_DIV_ID = 'proxy-view-effective-content';
ProxyView.RELOAD_SETTINGS_BUTTON_ID = 'proxy-view-reload-settings';
ProxyView.BAD_PROXIES_DIV_ID = 'proxy-view-bad-proxies-div';
ProxyView.BAD_PROXIES_TBODY_ID = 'proxy-view-bad-proxies-tbody';
@@ -75,10 +77,14 @@ var ProxyView = (function() {
var original = proxySettings.original;
var effective = proxySettings.effective;
- $(ProxyView.ORIGINAL_SETTINGS_DIV_ID).innerText =
- proxySettingsToString(original);
- $(ProxyView.EFFECTIVE_SETTINGS_DIV_ID).innerText =
- proxySettingsToString(effective);
+ var originalStr = proxySettingsToString(original);
+ var effectiveStr = proxySettingsToString(effective);
+
+ setNodeDisplay($(ProxyView.ORIGINAL_CONTENT_DIV_ID),
+ originalStr != effectiveStr);
+
+ $(ProxyView.ORIGINAL_SETTINGS_DIV_ID).innerText = originalStr;
+ $(ProxyView.EFFECTIVE_SETTINGS_DIV_ID).innerText = effectiveStr;
this.updateSocksHints_(effective);