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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 onDownloadData_: function() { | 79 onDownloadData_: function() { |
80 var dump_object = | 80 var dump_object = |
81 { | 81 { |
82 'getUserMedia': userMediaRequests, | 82 'getUserMedia': userMediaRequests, |
83 'PeerConnections': peerConnectionDataStore, | 83 'PeerConnections': peerConnectionDataStore, |
84 }; | 84 }; |
85 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], | 85 var textBlob = new Blob([JSON.stringify(dump_object, null, ' ')], |
86 {type: 'octet/stream'}); | 86 {type: 'octet/stream'}); |
87 var URL = window.URL.createObjectURL(textBlob); | 87 var URL = window.URL.createObjectURL(textBlob); |
88 | 88 |
89 this.root_.getElementsByTagName('a')[0].href = URL; | 89 var anchor = this.root_.getElementsByTagName('a')[0]; |
| 90 anchor.href = URL; |
| 91 anchor.download = 'webrtc_internals_dump.txt'; |
90 // The default action of the anchor will download the URL. | 92 // The default action of the anchor will download the URL. |
91 }, | 93 }, |
92 | 94 |
93 /** | 95 /** |
94 * Handles the event of toggling the AEC recording state. | 96 * Handles the event of toggling the AEC recording state. |
95 * | 97 * |
96 * @private | 98 * @private |
97 */ | 99 */ |
98 onAecRecordingChanged_: function() { | 100 onAecRecordingChanged_: function() { |
99 var enabled = this.root_.getElementsByTagName('input')[0].checked; | 101 var enabled = this.root_.getElementsByTagName('input')[0].checked; |
100 if (enabled) { | 102 if (enabled) { |
101 chrome.send('enableAecRecording'); | 103 chrome.send('enableAecRecording'); |
102 } else { | 104 } else { |
103 chrome.send('disableAecRecording'); | 105 chrome.send('disableAecRecording'); |
104 } | 106 } |
105 }, | 107 }, |
106 }; | 108 }; |
107 return DumpCreator; | 109 return DumpCreator; |
108 })(); | 110 })(); |
OLD | NEW |