| 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 host resolver: | 6 * This view displays information on the host resolver: |
| 7 * | 7 * |
| 8 * - Shows the default address family. | 8 * - Shows the default address family. |
| 9 * - Has a button to enable IPv6, if it is disabled. | 9 * - Has a button to enable IPv6, if it is disabled. |
| 10 * - Shows the current host cache contents. | 10 * - Shows the current host cache contents. |
| 11 * - Has a button to clear the host cache. | 11 * - Has a button to clear the host cache. |
| 12 * - Shows the parameters used to construct the host cache (capacity, ttl). | 12 * - Shows the parameters used to construct the host cache (capacity, ttl). |
| 13 */ | 13 */ |
| 14 | 14 |
| 15 var DnsView = (function() { | 15 var DnsView = (function() { |
| 16 'use strict'; |
| 17 |
| 16 // IDs for special HTML elements in dns_view.html | 18 // IDs for special HTML elements in dns_view.html |
| 17 const MAIN_BOX_ID = 'dns-view-tab-content'; | 19 var MAIN_BOX_ID = 'dns-view-tab-content'; |
| 18 const CACHE_TBODY_ID = 'dns-view-cache-tbody'; | 20 var CACHE_TBODY_ID = 'dns-view-cache-tbody'; |
| 19 const CLEAR_CACHE_BUTTON_ID = 'dns-view-clear-cache'; | 21 var CLEAR_CACHE_BUTTON_ID = 'dns-view-clear-cache'; |
| 20 const DEFAULT_FAMILY_SPAN_ID = 'dns-view-default-family'; | 22 var DEFAULT_FAMILY_SPAN_ID = 'dns-view-default-family'; |
| 21 const IPV6_DISABLED_SPAN_ID = 'dns-view-ipv6-disabled'; | 23 var IPV6_DISABLED_SPAN_ID = 'dns-view-ipv6-disabled'; |
| 22 const ENABLE_IPV6_BUTTON_ID = 'dns-view-enable-ipv6'; | 24 var ENABLE_IPV6_BUTTON_ID = 'dns-view-enable-ipv6'; |
| 23 const CAPACITY_SPAN_ID = 'dns-view-cache-capacity'; | 25 var CAPACITY_SPAN_ID = 'dns-view-cache-capacity'; |
| 24 const TTL_SUCCESS_SPAN_ID = 'dns-view-cache-ttl-success'; | 26 var TTL_SUCCESS_SPAN_ID = 'dns-view-cache-ttl-success'; |
| 25 const TTL_FAILURE_SPAN_ID = 'dns-view-cache-ttl-failure'; | 27 var TTL_FAILURE_SPAN_ID = 'dns-view-cache-ttl-failure'; |
| 26 | 28 |
| 27 // We inherit from DivView. | 29 // We inherit from DivView. |
| 28 var superClass = DivView; | 30 var superClass = DivView; |
| 29 | 31 |
| 30 /** | 32 /** |
| 31 * @constructor | 33 * @constructor |
| 32 */ | 34 */ |
| 33 function DnsView() { | 35 function DnsView() { |
| 36 assertFirstConstructorCall(DnsView); |
| 37 |
| 34 // Call superclass's constructor. | 38 // Call superclass's constructor. |
| 35 superClass.call(this, MAIN_BOX_ID); | 39 superClass.call(this, MAIN_BOX_ID); |
| 36 | 40 |
| 37 $(ENABLE_IPV6_BUTTON_ID).onclick = g_browser.enableIPv6.bind(g_browser); | 41 $(ENABLE_IPV6_BUTTON_ID).onclick = g_browser.enableIPv6.bind(g_browser); |
| 38 $(CLEAR_CACHE_BUTTON_ID).onclick = | 42 $(CLEAR_CACHE_BUTTON_ID).onclick = |
| 39 g_browser.sendClearHostResolverCache.bind(g_browser); | 43 g_browser.sendClearHostResolverCache.bind(g_browser); |
| 40 | 44 |
| 41 // Register to receive changes to the host resolver info. | 45 // Register to receive changes to the host resolver info. |
| 42 g_browser.addHostResolverInfoObserver(this); | 46 g_browser.addHostResolverInfoObserver(this); |
| 43 } | 47 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 var expiresCell = addNode(tr, 'td'); | 110 var expiresCell = addNode(tr, 'td'); |
| 107 addTextNode(expiresCell, expiresDate.toLocaleString()); | 111 addTextNode(expiresCell, expiresDate.toLocaleString()); |
| 108 } | 112 } |
| 109 | 113 |
| 110 return true; | 114 return true; |
| 111 } | 115 } |
| 112 }; | 116 }; |
| 113 | 117 |
| 114 return DnsView; | 118 return DnsView; |
| 115 })(); | 119 })(); |
| OLD | NEW |