OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 options for importing/exporting the captured data. Its | 6 * This view displays options for importing/exporting the captured data. Its |
7 * primarily usefulness is to allow users to copy-paste their data in an easy | 7 * primarily usefulness is to allow users to copy-paste their data in an easy |
8 * to read format for bug reports. | 8 * to read format for bug reports. |
9 * | 9 * |
10 * - Has a button to generate a text report. | 10 * - Has a button to generate a text report. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 text.push('Number of passively captured events: ' + | 89 text.push('Number of passively captured events: ' + |
90 g_browser.getAllPassivelyCapturedEvents().length); | 90 g_browser.getAllPassivelyCapturedEvents().length); |
91 text.push('Number of actively captured events: ' + | 91 text.push('Number of actively captured events: ' + |
92 g_browser.getAllActivelyCapturedEvents().length); | 92 g_browser.getAllActivelyCapturedEvents().length); |
93 text.push(''); | 93 text.push(''); |
94 | 94 |
95 text.push('Chrome version: ' + ClientInfo.version + | 95 text.push('Chrome version: ' + ClientInfo.version + |
96 ' (' + ClientInfo.official + | 96 ' (' + ClientInfo.official + |
97 ' ' + ClientInfo.cl + | 97 ' ' + ClientInfo.cl + |
98 ') ' + ClientInfo.version_mod); | 98 ') ' + ClientInfo.version_mod); |
| 99 // Third value in first set of parentheses in user-agent string. |
| 100 var platform = /\(.*?;.*?; (.*?);/.exec(navigator.userAgent); |
| 101 if (platform) |
| 102 text.push('Platform: ' + platform[1]); |
99 text.push('Command line: ' + ClientInfo.command_line); | 103 text.push('Command line: ' + ClientInfo.command_line); |
100 | 104 |
101 text.push(''); | 105 text.push(''); |
102 text.push('----------------------------------------------'); | 106 text.push('----------------------------------------------'); |
103 text.push(' Proxy settings (effective)'); | 107 text.push(' Proxy settings (effective)'); |
104 text.push('----------------------------------------------'); | 108 text.push('----------------------------------------------'); |
105 text.push(''); | 109 text.push(''); |
106 | 110 |
107 text.push(proxySettingsToString( | 111 text.push(proxySettingsToString( |
108 g_browser.proxySettings_.currentData_.effective)); | 112 g_browser.proxySettings_.currentData_.effective)); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 text.push(''); | 190 text.push(''); |
187 text.push('----------------------------------------------'); | 191 text.push('----------------------------------------------'); |
188 text.push(' Http cache stats'); | 192 text.push(' Http cache stats'); |
189 text.push('----------------------------------------------'); | 193 text.push('----------------------------------------------'); |
190 text.push(''); | 194 text.push(''); |
191 | 195 |
192 var httpCacheStats = g_browser.httpCacheInfo_.currentData_.stats; | 196 var httpCacheStats = g_browser.httpCacheInfo_.currentData_.stats; |
193 for (var statName in httpCacheStats) | 197 for (var statName in httpCacheStats) |
194 text.push(statName + ': ' + httpCacheStats[statName]); | 198 text.push(statName + ': ' + httpCacheStats[statName]); |
195 | 199 |
| 200 if (g_browser.isPlatformWindows()) { |
| 201 text.push(''); |
| 202 text.push('----------------------------------------------'); |
| 203 text.push(' Winsock layered service providers'); |
| 204 text.push('----------------------------------------------'); |
| 205 text.push(''); |
| 206 |
| 207 var serviceProviders = g_browser.serviceProviders_.currentData_; |
| 208 var layeredServiceProviders = serviceProviders.service_providers; |
| 209 for (var i = 0; i < layeredServiceProviders.length; ++i) { |
| 210 var provider = layeredServiceProviders[i]; |
| 211 text.push('name: ' + provider.name); |
| 212 text.push('version: ' + provider.version); |
| 213 text.push('type: ' + |
| 214 ServiceProvidersView.getLayeredServiceProviderType(provider)); |
| 215 text.push('socket_type: ' + |
| 216 ServiceProvidersView.getSocketType(provider)); |
| 217 text.push('socket_protocol: ' + |
| 218 ServiceProvidersView.getProtocolType(provider)); |
| 219 text.push('path: ' + provider.path); |
| 220 text.push(''); |
| 221 } |
| 222 |
| 223 text.push(''); |
| 224 text.push('----------------------------------------------'); |
| 225 text.push(' Winsock namespace providers'); |
| 226 text.push('----------------------------------------------'); |
| 227 text.push(''); |
| 228 |
| 229 var namespaceProviders = serviceProviders.namespace_providers; |
| 230 for (var i = 0; i < namespaceProviders.length; ++i) { |
| 231 var provider = namespaceProviders[i]; |
| 232 text.push('name: ' + provider.name); |
| 233 text.push('version: ' + provider.version); |
| 234 text.push('type: ' + |
| 235 ServiceProvidersView.getNamespaceProviderType(provider)); |
| 236 text.push('active: ' + provider.active); |
| 237 text.push(''); |
| 238 } |
| 239 } |
| 240 |
196 // Open a new window to display this text. | 241 // Open a new window to display this text. |
197 this.setText_(text.join('\n')); | 242 this.setText_(text.join('\n')); |
198 | 243 |
199 this.selectText_(); | 244 this.selectText_(); |
200 }; | 245 }; |
201 | 246 |
202 DataView.prototype.appendRequestsPrintedAsText_ = function(out) { | 247 DataView.prototype.appendRequestsPrintedAsText_ = function(out) { |
203 // Concatenate the passively captured events with the actively captured events | 248 // Concatenate the passively captured events with the actively captured events |
204 // into a single array. | 249 // into a single array. |
205 var allEvents = g_browser.getAllPassivelyCapturedEvents().concat( | 250 var allEvents = g_browser.getAllPassivelyCapturedEvents().concat( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 * Select all text from log dump. | 323 * Select all text from log dump. |
279 */ | 324 */ |
280 DataView.prototype.selectText_ = function() { | 325 DataView.prototype.selectText_ = function() { |
281 var selection = window.getSelection(); | 326 var selection = window.getSelection(); |
282 selection.removeAllRanges(); | 327 selection.removeAllRanges(); |
283 | 328 |
284 var range = document.createRange(); | 329 var range = document.createRange(); |
285 range.selectNodeContents(this.textPre_); | 330 range.selectNodeContents(this.textPre_); |
286 selection.addRange(range); | 331 selection.addRange(range); |
287 }; | 332 }; |
OLD | NEW |