From 9af6d639460e0631c2b078397373445fbe2b67b9 Mon Sep 17 00:00:00 2001 From: "ellyjones@chromium.org" Date: Wed, 20 Nov 2013 04:12:48 +0000 Subject: [PATCH] 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 --- chrome/browser/resources/net_internals/proxy_view.html | 12 ++++++++---- chrome/browser/resources/net_internals/proxy_view.js | 14 ++++++++++---- 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 cfe1335327bd..b2c754879ef6 100644 --- a/chrome/browser/resources/net_internals/proxy_view.html +++ b/chrome/browser/resources/net_internals/proxy_view.html @@ -21,11 +21,15 @@
-

Effective proxy settings

-

+  
+

Effective proxy settings

+

+  
-

Original proxy settings

-

+  
+

Original proxy settings

+

+  
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 35263f973c8d..ef9709dde4fc 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); -- 2.11.4.GIT