OLD | NEW |
1 // Copyright (c) 2011 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 a summary of the state of each SPDY sessions, and | 6 * This view displays a summary of the state of each SPDY sessions, and |
7 * has links to display them in the events tab. | 7 * has links to display them in the events tab. |
8 */ | 8 */ |
9 var SpdyView = (function() { | 9 var SpdyView = (function() { |
10 'use strict'; | 10 'use strict'; |
11 | 11 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 setNodeDisplay(this.spdySessionNoneSpan_, hasNoSession); | 81 setNodeDisplay(this.spdySessionNoneSpan_, hasNoSession); |
82 setNodeDisplay(this.spdySessionLinkSpan_, !hasNoSession); | 82 setNodeDisplay(this.spdySessionLinkSpan_, !hasNoSession); |
83 | 83 |
84 // Only want to be hide the tab if there's no data. In the case of having | 84 // Only want to be hide the tab if there's no data. In the case of having |
85 // data but no sessions, still show the tab. | 85 // data but no sessions, still show the tab. |
86 if (!spdySessionInfo) | 86 if (!spdySessionInfo) |
87 return false; | 87 return false; |
88 | 88 |
89 if (!hasNoSession) { | 89 if (!hasNoSession) { |
90 var tablePrinter = createSessionTablePrinter(spdySessionInfo); | 90 var tablePrinter = createSessionTablePrinter(spdySessionInfo); |
91 tablePrinter.toHTML(this.spdySessionDiv_, 'styledTable'); | 91 tablePrinter.toHTML(this.spdySessionDiv_, 'styled-table'); |
92 } | 92 } |
93 | 93 |
94 return true; | 94 return true; |
95 }, | 95 }, |
96 | 96 |
97 /** | 97 /** |
98 * Displays information on the global SPDY status. | 98 * Displays information on the global SPDY status. |
99 */ | 99 */ |
100 onSpdyStatusChanged: function(spdyStatus) { | 100 onSpdyStatusChanged: function(spdyStatus) { |
101 this.spdyEnabledSpan_.textContent = spdyStatus.spdy_enabled; | 101 this.spdyEnabledSpan_.textContent = spdyStatus.spdy_enabled; |
(...skipping 14 matching lines...) Expand all Loading... |
116 onSpdyAlternateProtocolMappingsChanged: | 116 onSpdyAlternateProtocolMappingsChanged: |
117 function(spdyAlternateProtocolMappings) { | 117 function(spdyAlternateProtocolMappings) { |
118 | 118 |
119 this.spdyAlternateProtocolMappingsDiv_.innerHTML = ''; | 119 this.spdyAlternateProtocolMappingsDiv_.innerHTML = ''; |
120 | 120 |
121 if (spdyAlternateProtocolMappings != null && | 121 if (spdyAlternateProtocolMappings != null && |
122 spdyAlternateProtocolMappings.length > 0) { | 122 spdyAlternateProtocolMappings.length > 0) { |
123 var tabPrinter = createAlternateProtocolMappingsTablePrinter( | 123 var tabPrinter = createAlternateProtocolMappingsTablePrinter( |
124 spdyAlternateProtocolMappings); | 124 spdyAlternateProtocolMappings); |
125 tabPrinter.toHTML( | 125 tabPrinter.toHTML( |
126 this.spdyAlternateProtocolMappingsDiv_, 'styledTable'); | 126 this.spdyAlternateProtocolMappingsDiv_, 'styled-table'); |
127 } else { | 127 } else { |
128 this.spdyAlternateProtocolMappingsDiv_.innerHTML = 'None'; | 128 this.spdyAlternateProtocolMappingsDiv_.innerHTML = 'None'; |
129 } | 129 } |
130 return true; | 130 return true; |
131 } | 131 } |
132 }; | 132 }; |
133 | 133 |
134 /** | 134 /** |
135 * Creates a table printer to print out the state of list of SPDY sessions. | 135 * Creates a table printer to print out the state of list of SPDY sessions. |
136 */ | 136 */ |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 tablePrinter.addRow(); | 193 tablePrinter.addRow(); |
194 | 194 |
195 tablePrinter.addCell(entry.host_port_pair); | 195 tablePrinter.addCell(entry.host_port_pair); |
196 tablePrinter.addCell(entry.alternate_protocol); | 196 tablePrinter.addCell(entry.alternate_protocol); |
197 } | 197 } |
198 return tablePrinter; | 198 return tablePrinter; |
199 } | 199 } |
200 | 200 |
201 return SpdyView; | 201 return SpdyView; |
202 })(); | 202 })(); |
OLD | NEW |