| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 /** | 6 /** |
| 7 * Provides the UI for dump creation. | 7 * Provides the UI for dump creation. |
| 8 */ | 8 */ |
| 9 var DumpCreator = (function() { | 9 var DumpCreator = (function() { |
| 10 /** | 10 /** |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 enableAecRecording: function() { | 51 enableAecRecording: function() { |
| 52 this.root_.getElementsByTagName('input')[0].checked = true; | 52 this.root_.getElementsByTagName('input')[0].checked = true; |
| 53 }, | 53 }, |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Downloads the PeerConnection updates and stats data as a file. | 56 * Downloads the PeerConnection updates and stats data as a file. |
| 57 * | 57 * |
| 58 * @private | 58 * @private |
| 59 */ | 59 */ |
| 60 onDownloadData_: function() { | 60 onDownloadData_: function() { |
| 61 var textBlob = | 61 var dump_object = |
| 62 new Blob([JSON.stringify(peerConnectionDataStore, null, ' ')], | 62 { |
| 63 {type: 'octet/stream'}); | 63 'getUserMedia': userMediaRequests, |
| 64 'PeerConnections': peerConnectionDataStore, |
| 65 }; |
| 66 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], |
| 67 {type: 'octet/stream'}); |
| 64 var URL = window.URL.createObjectURL(textBlob); | 68 var URL = window.URL.createObjectURL(textBlob); |
| 69 |
| 65 this.root_.getElementsByTagName('a')[0].href = URL; | 70 this.root_.getElementsByTagName('a')[0].href = URL; |
| 66 // The default action of the anchor will download the URL. | 71 // The default action of the anchor will download the URL. |
| 67 }, | 72 }, |
| 68 | 73 |
| 69 /** | 74 /** |
| 70 * Handles the event of toggling the AEC recording state. | 75 * Handles the event of toggling the AEC recording state. |
| 71 * | 76 * |
| 72 * @private | 77 * @private |
| 73 */ | 78 */ |
| 74 onAecRecordingChanged_: function() { | 79 onAecRecordingChanged_: function() { |
| 75 var enabled = this.root_.getElementsByTagName('input')[0].checked; | 80 var enabled = this.root_.getElementsByTagName('input')[0].checked; |
| 76 if (enabled) { | 81 if (enabled) { |
| 77 chrome.send('enableAecRecording'); | 82 chrome.send('enableAecRecording'); |
| 78 } else { | 83 } else { |
| 79 chrome.send('disableAecRecording'); | 84 chrome.send('disableAecRecording'); |
| 80 } | 85 } |
| 81 }, | 86 }, |
| 82 }; | 87 }; |
| 83 return DumpCreator; | 88 return DumpCreator; |
| 84 })(); | 89 })(); |
| OLD | NEW |