Chromium Code Reviews| Index: chrome/browser/resources/sync_internals/traffic.js |
| diff --git a/chrome/browser/resources/sync_internals/traffic.js b/chrome/browser/resources/sync_internals/traffic.js |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..42a92a3b52971f11bcb769fef44374221869b4f9 |
| --- /dev/null |
| +++ b/chrome/browser/resources/sync_internals/traffic.js |
| @@ -0,0 +1,22 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +(function() { |
|
rlarocque
2012/03/29 22:54:27
I don't think this is good style, though I'm not s
lipalani1
2012/03/29 23:58:37
ha ha I dont know either. I just copied from other
akalin
2012/03/30 01:55:04
This is the 'Javascript way' of avoiding pollution
|
| +var trafficToTextButton = document.getElementById('traffic-to-text'); |
| +var trafficDump = document.getElementById('traffic-dump'); |
| +trafficToTextButton.addEventListener('click', function(event) { |
| + chrome.sync.getClientServerTraffic(printData); |
| +}); |
| + |
| +function printData(trafficRecord) { |
| + var traffic_data = ''; |
| + traffic_data += '===\n'; |
| + traffic_data += 'Client Server Traffic\n'; |
| + traffic_data += '===\n'; |
| + traffic_data += JSON.stringify(trafficRecord, null, 2); |
| + traffic_data += '\n'; |
| + |
| + trafficDump.textContent = traffic_data; |
| +} |
| +})(); |