OLD | NEW |
1 // Copyright (c) 2010 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". |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 if (logEntry.source.id > this.latestProxySourceId_) { | 86 if (logEntry.source.id > this.latestProxySourceId_) { |
87 this.latestProxySourceId_ = logEntry.source.id; | 87 this.latestProxySourceId_ = logEntry.source.id; |
88 this.latestProxySourceEntries_ = []; | 88 this.latestProxySourceEntries_ = []; |
89 } | 89 } |
90 | 90 |
91 this.latestProxySourceEntries_.push(logEntry); | 91 this.latestProxySourceEntries_.push(logEntry); |
92 this.proxyResolverLogPre_.innerHTML = ''; | 92 this.proxyResolverLogPre_.innerHTML = ''; |
93 addTextNode(this.proxyResolverLogPre_, | 93 addTextNode(this.proxyResolverLogPre_, |
94 PrintSourceEntriesAsText(this.latestProxySourceEntries_, false)); | 94 PrintSourceEntriesAsText(this.latestProxySourceEntries_)); |
95 }; | 95 }; |
96 | 96 |
97 /** | 97 /** |
98 * Clears the display of and log entries for the last proxy lookup. | 98 * Clears the display of and log entries for the last proxy lookup. |
99 */ | 99 */ |
100 ProxyView.prototype.clearLog_ = function() { | 100 ProxyView.prototype.clearLog_ = function() { |
101 this.latestProxySourceEntries_ = []; | 101 this.latestProxySourceEntries_ = []; |
102 // Prevents display of partial logs. | 102 // Prevents display of partial logs. |
103 ++this.latestProxySourceId_; | 103 ++this.latestProxySourceId_; |
104 | 104 |
105 this.proxyResolverLogPre_.innerHTML = ''; | 105 this.proxyResolverLogPre_.innerHTML = ''; |
106 addTextNode(this.proxyResolverLogPre_, 'Deleted.'); | 106 addTextNode(this.proxyResolverLogPre_, 'Deleted.'); |
107 }; | 107 }; |
108 | 108 |
109 ProxyView.prototype.onLogEntriesDeleted = function(sourceIds) { | 109 ProxyView.prototype.onLogEntriesDeleted = function(sourceIds) { |
110 if (sourceIds.indexOf(this.latestProxySourceId_) != -1) | 110 if (sourceIds.indexOf(this.latestProxySourceId_) != -1) |
111 this.clearLog_(); | 111 this.clearLog_(); |
112 }; | 112 }; |
113 | 113 |
114 ProxyView.prototype.onAllLogEntriesDeleted = function() { | 114 ProxyView.prototype.onAllLogEntriesDeleted = function() { |
115 this.clearLog_(); | 115 this.clearLog_(); |
116 }; | 116 }; |
117 | 117 |
118 ProxyView.prototype.onSetIsViewingLogFile = function(isViewingLogFile) { | 118 ProxyView.prototype.onSetIsViewingLogFile = function(isViewingLogFile) { |
119 }; | 119 }; |
120 | 120 |
OLD | NEW |