| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * This view displays information on the proxy setup: | 6 * This view displays information on the proxy setup: |
| 7 * | 7 * |
| 8 * - Shows the current proxy settings. | 8 * - Shows the current proxy settings. |
| 9 * - Has a button to reload these settings. | 9 * - Has a button to reload these settings. |
| 10 * - Shows the log entries for the most recent INIT_PROXY_RESOLVER source | 10 * - Shows the log entries for the most recent INIT_PROXY_RESOLVER source |
| 11 * - Shows the list of proxy hostnames that are cached as "bad". | 11 * - Shows the list of proxy hostnames that are cached as "bad". |
| 12 * - Has a button to clear the cached bad proxies. | 12 * - Has a button to clear the cached bad proxies. |
| 13 */ | 13 */ |
| 14 var ProxyView = (function() { |
| 15 'use strict'; |
| 14 | 16 |
| 15 var ProxyView = (function() { | |
| 16 // IDs for special HTML elements in proxy_view.html | 17 // IDs for special HTML elements in proxy_view.html |
| 17 const MAIN_BOX_ID = 'proxy-view-tab-content'; | 18 var MAIN_BOX_ID = 'proxy-view-tab-content'; |
| 18 const ORIGINAL_SETTINGS_DIV_ID = 'proxy-view-original-settings'; | 19 var ORIGINAL_SETTINGS_DIV_ID = 'proxy-view-original-settings'; |
| 19 const EFFECTIVE_SETTINGS_DIV_ID = 'proxy-view-effective-settings'; | 20 var EFFECTIVE_SETTINGS_DIV_ID = 'proxy-view-effective-settings'; |
| 20 const RELOAD_SETTINGS_BUTTON_ID = 'proxy-view-reload-settings'; | 21 var RELOAD_SETTINGS_BUTTON_ID = 'proxy-view-reload-settings'; |
| 21 const BAD_PROXIES_TBODY_ID = 'proxy-view-bad-proxies-tbody'; | 22 var BAD_PROXIES_TBODY_ID = 'proxy-view-bad-proxies-tbody'; |
| 22 const CLEAR_BAD_PROXIES_BUTTON_ID = 'proxy-view-clear-bad-proxies'; | 23 var CLEAR_BAD_PROXIES_BUTTON_ID = 'proxy-view-clear-bad-proxies'; |
| 23 const PROXY_RESOLVER_LOG_PRE_ID = 'proxy-view-resolver-log'; | 24 var PROXY_RESOLVER_LOG_PRE_ID = 'proxy-view-resolver-log'; |
| 24 | 25 |
| 25 // We inherit from DivView. | 26 // We inherit from DivView. |
| 26 var superClass = DivView; | 27 var superClass = DivView; |
| 27 | 28 |
| 28 /** | 29 /** |
| 29 * @constructor | 30 * @constructor |
| 30 */ | 31 */ |
| 31 function ProxyView() { | 32 function ProxyView() { |
| 33 assertFirstConstructorCall(ProxyView); |
| 34 |
| 32 // Call superclass's constructor. | 35 // Call superclass's constructor. |
| 33 superClass.call(this, MAIN_BOX_ID); | 36 superClass.call(this, MAIN_BOX_ID); |
| 34 | 37 |
| 35 this.latestProxySourceId_ = 0; | 38 this.latestProxySourceId_ = 0; |
| 36 | 39 |
| 37 // Hook up the UI components. | 40 // Hook up the UI components. |
| 38 $(RELOAD_SETTINGS_BUTTON_ID).onclick = | 41 $(RELOAD_SETTINGS_BUTTON_ID).onclick = |
| 39 g_browser.sendReloadProxySettings.bind(g_browser); | 42 g_browser.sendReloadProxySettings.bind(g_browser); |
| 40 $(CLEAR_BAD_PROXIES_BUTTON_ID).onclick = | 43 $(CLEAR_BAD_PROXIES_BUTTON_ID).onclick = |
| 41 g_browser.sendClearBadProxies.bind(g_browser); | 44 g_browser.sendClearBadProxies.bind(g_browser); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 this.clearLog_(); | 159 this.clearLog_(); |
| 157 }, | 160 }, |
| 158 | 161 |
| 159 onAllSourceEntriesDeleted: function() { | 162 onAllSourceEntriesDeleted: function() { |
| 160 this.clearLog_(); | 163 this.clearLog_(); |
| 161 } | 164 } |
| 162 }; | 165 }; |
| 163 | 166 |
| 164 return ProxyView; | 167 return ProxyView; |
| 165 })(); | 168 })(); |
| OLD | NEW |