| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * - Shows the current host cache contents. | 9 * - Shows the current host cache contents. |
| 10 * - Has a button to clear the host cache. | 10 * - Has a button to clear the host cache. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * @constructor | 26 * @constructor |
| 27 */ | 27 */ |
| 28 function DnsView() { | 28 function DnsView() { |
| 29 assertFirstConstructorCall(DnsView); | 29 assertFirstConstructorCall(DnsView); |
| 30 | 30 |
| 31 // Call superclass's constructor. | 31 // Call superclass's constructor. |
| 32 superClass.call(this, DnsView.MAIN_BOX_ID); | 32 superClass.call(this, DnsView.MAIN_BOX_ID); |
| 33 | 33 |
| 34 $(DnsView.CLEAR_CACHE_BUTTON_ID).onclick = | |
| 35 g_browser.sendClearHostResolverCache.bind(g_browser); | |
| 36 | |
| 37 // Register to receive changes to the host resolver info. | 34 // Register to receive changes to the host resolver info. |
| 38 g_browser.addHostResolverInfoObserver(this, false); | 35 g_browser.addHostResolverInfoObserver(this, false); |
| 39 } | 36 } |
| 40 | 37 |
| 41 DnsView.TAB_ID = 'tab-handle-dns'; | 38 DnsView.TAB_ID = 'tab-handle-dns'; |
| 42 DnsView.TAB_NAME = 'DNS'; | 39 DnsView.TAB_NAME = 'DNS'; |
| 43 DnsView.TAB_HASH = '#dns'; | 40 DnsView.TAB_HASH = '#dns'; |
| 44 | 41 |
| 45 // IDs for special HTML elements in dns_view.html | 42 // IDs for special HTML elements in dns_view.html |
| 46 DnsView.MAIN_BOX_ID = 'dns-view-tab-content'; | 43 DnsView.MAIN_BOX_ID = 'dns-view-tab-content'; |
| 47 | 44 |
| 48 DnsView.INTERNAL_DNS_ENABLED_SPAN_ID = 'dns-view-internal-dns-enabled'; | 45 DnsView.INTERNAL_DNS_ENABLED_SPAN_ID = 'dns-view-internal-dns-enabled'; |
| 49 DnsView.INTERNAL_DNS_INVALID_CONFIG_SPAN_ID = | 46 DnsView.INTERNAL_DNS_INVALID_CONFIG_SPAN_ID = |
| 50 'dns-view-internal-dns-invalid-config'; | 47 'dns-view-internal-dns-invalid-config'; |
| 51 DnsView.INTERNAL_DNS_CONFIG_TBODY_ID = 'dns-view-internal-dns-config-tbody'; | 48 DnsView.INTERNAL_DNS_CONFIG_TBODY_ID = 'dns-view-internal-dns-config-tbody'; |
| 52 | 49 |
| 53 DnsView.CLEAR_CACHE_BUTTON_ID = 'dns-view-clear-cache'; | |
| 54 DnsView.CAPACITY_SPAN_ID = 'dns-view-cache-capacity'; | 50 DnsView.CAPACITY_SPAN_ID = 'dns-view-cache-capacity'; |
| 55 | 51 |
| 56 DnsView.ACTIVE_SPAN_ID = 'dns-view-cache-active'; | 52 DnsView.ACTIVE_SPAN_ID = 'dns-view-cache-active'; |
| 57 DnsView.EXPIRED_SPAN_ID = 'dns-view-cache-expired'; | 53 DnsView.EXPIRED_SPAN_ID = 'dns-view-cache-expired'; |
| 58 DnsView.CACHE_TBODY_ID = 'dns-view-cache-tbody'; | 54 DnsView.CACHE_TBODY_ID = 'dns-view-cache-tbody'; |
| 59 | 55 |
| 60 cr.addSingletonGetter(DnsView); | 56 cr.addSingletonGetter(DnsView); |
| 61 | 57 |
| 62 DnsView.prototype = { | 58 DnsView.prototype = { |
| 63 // Inherit the superclass's methods. | 59 // Inherit the superclass's methods. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 * @param {Array<string>} list List of strings to add to the node. | 187 * @param {Array<string>} list List of strings to add to the node. |
| 192 */ | 188 */ |
| 193 function addListToNode_(node, list) { | 189 function addListToNode_(node, list) { |
| 194 for (var i = 0; i < list.length; ++i) | 190 for (var i = 0; i < list.length; ++i) |
| 195 addNodeWithText(node, 'div', list[i]); | 191 addNodeWithText(node, 'div', list[i]); |
| 196 } | 192 } |
| 197 | 193 |
| 198 return DnsView; | 194 return DnsView; |
| 199 })(); | 195 })(); |
| 200 | 196 |
| OLD | NEW |